Exemple #1
0
 public void run() {
   while (true) {
     InputChar c = Toolkit.readCharacter();
     String a = "" + c.getCharacter();
     Tetris.test.turnGamePiece(Tetris.test.GameObjects.get(0), a);
   }
 }
Exemple #2
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;
    }
  }