예제 #1
0
  public void keyPressed() {
    if (menu.startPressed()) {
      int keyIndex = -1;
      if (key >= 'A' && key <= 'Z') {
        keyIndex = key - 'A';
      } else if (key >= 'a' && key <= 'z') {
        keyIndex = key - 'a';
      }

      // If it's not a letter key
      if (keyIndex == -1) {

        if (key == BACKSPACE) {
          levels.removeLastLetter();
        } else if (key == ENTER && levels.tfs.getUserWord() != "") {
          levels.enterPressed();
        }

      }
      // It's a letter key
      else {
        String temp = "" + key;
        levels.appendUserWord(temp);
      }
    }
  }