@Override public void processKeyEvent(KeyEvent evt){
  if (inputHandler == null) {
    return;
  }
switch (evt.getID()) {
case KeyEvent.KEY_TYPED:
    inputHandler.keyTyped(evt);
  break;
case KeyEvent.KEY_PRESSED:
inputHandler.keyPressed(evt);
break;
case KeyEvent.KEY_RELEASED:
inputHandler.keyReleased(evt);
break;
}
}

@ Override public void processKeyEvent ( KeyEvent evt ) { if ( inputHandler == null ) { return ; } switch ( evt . getID ( ) ) { case KeyEvent . KEY_TYPED : inputHandler . keyTyped ( evt ) ; break ; case KeyEvent . KEY_PRESSED : inputHandler . keyPressed ( evt ) ; break ; case KeyEvent . KEY_RELEASED : inputHandler . keyReleased ( evt ) ; break ; } }
forwards key events directly to the input handler . this is slightly faster than using a keylistener because some swing overhead is avoided .
