public void onKeyPressed(final int keyCode){
  if (!pressedStateKeys.contains(keyCode)) {
    pressedStateKeys.add(keyCode);
  }
}

public void onKeyPressed ( final int keyCode ) { if ( ! pressedStateKeys . contains ( keyCode ) ) { pressedStateKeys . add ( keyCode ) ; } }
add a keypress to pressedstatekeys list .
