예제 #1
0
 public void run() {
   while (true) {
     InputChar c = Toolkit.readCharacter();
     String a = "" + c.getCharacter();
     Tetris.test.turnGamePiece(Tetris.test.GameObjects.get(0), a);
   }
 }
예제 #2
0
 protected void onChar(InputChar inp) {
   if (inp.equals(__returnChar)) {
     if (_filterField.hasFocus()) {
       setFilterString(_filterField.getText());
       updateListWidgets();
     } else {
       saveResult();
       close();
     }
   }
 }
예제 #3
0
  @Override
  protected boolean handleInput(InputChar ch) {
    if (ch.equals(__changeValueChar)) {
      if (_items.size() > 2) {
        PopUpMenu menu = new PopUpMenu(getAbsoluteX(), getAbsoluteY(), null);
        for (int i = 0; i < _items.size(); i++) {
          menu.add((String) _items.elementAt(i));
        }
        menu.show();
        if ((menu.getSelectedIndex() != -1) && (menu.getSelectedIndex() != getSelectedIndex())) {
          _selectedIndex = menu.getSelectedIndex();
          paint();
          _listenerManager.handleEvent(new ValueChangedEvent(this));
        }
      }

      return true;
    }

    return false;
  }
예제 #4
0
  /** Input-Behandlundg */
  protected boolean handleInput(InputChar ch) {

    boolean filter =
        (ch.getCode() == InputChar.KEY_UP)
            || (ch.getCode() == InputChar.KEY_DOWN)
            || (ch.getCode() == InputChar.KEY_NPAGE)
            || (ch.getCode() == InputChar.KEY_PPAGE)
            || (ch.getCode() == InputChar.KEY_END)
            || (ch.getCode() == InputChar.KEY_HOME)
            || ((!ch.isSpecialCode()) && (ch.getCharacter() == '\n'))
            || ((!ch.isSpecialCode()) && (ch.getCharacter() == '\r'));
    if (!filter) {
      return super.handleInput(ch);
    } else {
      return false;
    }
  }