int fs = screenFields.getCurrentFieldShift();
   protected boolean simulateKeyStroke(char c){      if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) {         restoreErrorLine();         setStatus(STATUS_ERROR_CODE,STATUS_VALUE_OFF,null);      }      boolean updateField = false;      boolean numericError = false;      boolean updatePos = false;      boolean autoEnter = false;      if (!Character.isISOControl(c)) {         if (screenFields.getCurrentField() != null &&            screenFields.withinCurrentField(lastPos)            && !screenFields.isCurrentFieldBypassField()) {            switch (screenFields.getCurrentFieldShift()) {               case 0:  // Alpha shift               case 2:  // Numeric Shift                  updateField = true;                  break;               case 1:  // Alpha Only                  if(Character.isLetter(c) || c == ',' || c == '-' || c == '.' || c == ' ')                     updateField = true;                  break;               case 3: // Numeric only                  if(Character.isDigit(c) || c == '+' || c == ',' || c == '-' || c == '.' || c == ' ')                     updateField = true;                  else                     numericError = true;                  break;               case 5: // Digits only                  if(Character.isDigit(c))                     updateField = true;                  else                     displayError(ERR_NUMERIC_09);                  break;               case 7: // Signed numeric                  if(Character.isDigit(c) || c == '+' || c == '-')                     if (lastPos == screenFields.getCurrentField().endPos()                              && (c != '+' && c != '-'))                        displayError(ERR_INVALID_SIGN);                     else                        updateField = true;                  else                     displayError(ERR_NUMERIC_09);                  break;            }            if (updateField) {               if (screenFields.isCurrentFieldToUpper())                  c = Character.toUpperCase(c);               setCursorOff();               updatePos = true;               resetDirty(lastPos);               if (insertMode) {                  if (endOfField(false) != screenFields.getCurrentField().endPos())                     shiftRight(lastPos);                  else {                     displayError(ERR_NO_ROOM_INSERT);                     updatePos = false;                  }               }               if (updatePos) {                  screenFields.getCurrentField().getKeyPos(getRow(lastPos),getCol(lastPos));                  screenFields.getCurrentField().changePos(1);                  screen[lastPos].setChar(c);                  screenFields.setCurrentFieldMDT();                  // if we have gone passed the end of the field then goto the next field                  if (!screenFields.withinCurrentField(screenFields.getCurrentFieldPos())) {                     if (screenFields.isCurrentFieldAutoEnter()) {                        autoEnter = true;                     }                     else if (!screenFields.isCurrentFieldFER())                        gotoFieldNext();                  }                  else                     goto_XY(screenFields.getCurrentField().getCursorRow() + 1,screenFields.getCurrentField().getCursorCol() + 1);               }               updateImage(dirty);               setCursorOn();               if (autoEnter)                  sendAid(AID_ENTER);            }            else {               if (numericError) {                  displayError(ERR_NUMERIC_ONLY);               }            }         }         else {            displayError(ERR_CURSOR_PROTECTED);         }      }      return updatePos;   }