private void setupKeys() { InputManager inputManager = app.getInputManager(); inputManager.addMapping( "Rotate Left", new KeyTrigger(KeyInput.KEY_A), new KeyTrigger(KeyInput.KEY_LEFT)); inputManager.addMapping( "Rotate Right", new KeyTrigger(KeyInput.KEY_D), new KeyTrigger(KeyInput.KEY_RIGHT)); inputManager.addMapping( "Walk Forward", new KeyTrigger(KeyInput.KEY_W), new KeyTrigger(KeyInput.KEY_UP)); inputManager.addMapping( "Walk Backward", new KeyTrigger(KeyInput.KEY_S), new KeyTrigger(KeyInput.KEY_DOWN)); inputManager.addMapping("Jump", new KeyTrigger(KeyInput.KEY_SPACE)); // inputManager.addListener(this, "Strafe Left", "Strafe Right"); inputManager.addListener(this, "Rotate Left", "Rotate Right"); inputManager.addListener(this, "Walk Forward", "Walk Backward"); inputManager.addListener(this, "Jump"); inputManager = null; }
public void removeListener() { app.getInputManager().removeListener(this); }
public void addListener() { app.getInputManager().addListener(this, mappings); }