@Override public void simpleInitApp() { // Test multiple inputs per mapping inputManager.addMapping("My Action", new KeyTrigger(KeyInput.KEY_SPACE), new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false)); // Test multiple listeners per mapping inputManager.addListener(actionListener, "My Action"); inputManager.addListener(analogListener, "My Action"); }
private void initKeys() { // You can map one or several inputs to one named action this.inputManager.addMapping("Lefts", new KeyTrigger(KeyInput.KEY_A)); this.inputManager.addMapping("Rights", new KeyTrigger(KeyInput.KEY_D)); this.inputManager.addMapping("Ups", new KeyTrigger(KeyInput.KEY_W)); this.inputManager.addMapping("Downs", new KeyTrigger(KeyInput.KEY_S)); this.inputManager.addListener(this.actionListener, "Lefts"); this.inputManager.addListener(this.actionListener, "Rights"); this.inputManager.addListener(this.actionListener, "Ups"); this.inputManager.addListener(this.actionListener, "Downs"); } private boolean left;
/** * Sets custom triggers for zooming in the cam * default is * new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true) mouse wheel up * @param triggers */ public void setZoomInTrigger(Trigger... triggers) { inputManager.deleteMapping(CameraInput.CHASECAM_ZOOMIN); inputManager.addMapping(CameraInput.CHASECAM_ZOOMIN, triggers); inputManager.addListener(this, CameraInput.CHASECAM_ZOOMIN); }
/** * Sets custom triggers for zooming out the cam * default is * new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false) mouse wheel down * @param triggers */ public void setZoomOutTrigger(Trigger... triggers) { inputManager.deleteMapping(CameraInput.CHASECAM_ZOOMOUT); inputManager.addMapping(CameraInput.CHASECAM_ZOOMOUT, triggers); inputManager.addListener(this, CameraInput.CHASECAM_ZOOMOUT); }
private void setupKeys() { inputManager.addMapping("Lefts", new KeyTrigger(KeyInput.KEY_A)); inputManager.addMapping("Rights", new KeyTrigger(KeyInput.KEY_D)); inputManager.addMapping("Ups", new KeyTrigger(KeyInput.KEY_W)); inputManager.addMapping("Downs", new KeyTrigger(KeyInput.KEY_S)); inputManager.addMapping("Space", new KeyTrigger(KeyInput.KEY_SPACE)); inputManager.addListener(this,"Lefts"); inputManager.addListener(this,"Rights"); inputManager.addListener(this,"Ups"); inputManager.addListener(this,"Downs"); inputManager.addListener(this,"Space"); }
private void setupKeys() { inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); inputManager.addMapping("shoot2", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT)); inputManager.addListener(this, "shoot"); inputManager.addListener(this, "shoot2"); }
/** Custom Keybindings: Mapping a named action to a key input. */ private void initKeys() { inputManager.addMapping("Walk", new KeyTrigger(KeyInput.KEY_SPACE)); inputManager.addListener(actionListener, "Walk"); }
/** * Sets custom triggers for toggling the rotation of the cam * default are * new MouseButtonTrigger(MouseInput.BUTTON_LEFT) left mouse button * new MouseButtonTrigger(MouseInput.BUTTON_RIGHT) right mouse button * @param triggers */ public void setToggleRotationTrigger(Trigger... triggers) { inputManager.deleteMapping(CameraInput.CHASECAM_TOGGLEROTATE); inputManager.addMapping(CameraInput.CHASECAM_TOGGLEROTATE, triggers); inputManager.addListener(this, CameraInput.CHASECAM_TOGGLEROTATE); }
private void setupKeys() { flyCam.setMoveSpeed(50); inputManager.addMapping("wireframe", new KeyTrigger(KeyInput.KEY_T)); inputManager.addListener(actionListener, "wireframe"); inputManager.addMapping("triPlanar", new KeyTrigger(KeyInput.KEY_P)); inputManager.addListener(actionListener, "triPlanar"); inputManager.addMapping("WardIso", new KeyTrigger(KeyInput.KEY_9)); inputManager.addListener(actionListener, "WardIso"); inputManager.addMapping("DetachControl", new KeyTrigger(KeyInput.KEY_0)); inputManager.addListener(actionListener, "DetachControl"); } private ActionListener actionListener = new ActionListener() {
private void setupKeys() { flyCam.setMoveSpeed(50); inputManager.addMapping("wireframe", new KeyTrigger(KeyInput.KEY_T)); inputManager.addListener(actionListener, "wireframe"); inputManager.addMapping("triPlanar", new KeyTrigger(KeyInput.KEY_P)); inputManager.addListener(actionListener, "triPlanar"); } private ActionListener actionListener = new ActionListener() {
protected void initInput() { flyCam.setMoveSpeed(50); //init input inputManager.addMapping("fadein", new KeyTrigger(KeyInput.KEY_I)); inputManager.addListener(this, "fadein"); inputManager.addMapping("fadeout", new KeyTrigger(KeyInput.KEY_O)); inputManager.addListener(this, "fadeout"); }
private void setupKeys() { flyCam.setMoveSpeed(50); inputManager.addMapping("wireframe", new KeyTrigger(KeyInput.KEY_T)); inputManager.addListener(actionListener, "wireframe"); inputManager.addMapping("triPlanar", new KeyTrigger(KeyInput.KEY_P)); inputManager.addListener(actionListener, "triPlanar"); } private ActionListener actionListener = new ActionListener() {
/** Declaring the "Shoot" action and mapping to its triggers. */ private void initKeys() { inputManager.addMapping("Shoot", new KeyTrigger(KeyInput.KEY_SPACE), // trigger 1: spacebar new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); // trigger 2: left-button click inputManager.addListener(actionListener, "Shoot"); } /** Defining the "Shoot" action: Determine what was hit and how to respond. */
private void setupKeys() { flyCam.setMoveSpeed(100); inputManager.addMapping("wireframe", new KeyTrigger(KeyInput.KEY_T)); inputManager.addListener(actionListener, "wireframe"); } private ActionListener actionListener = new ActionListener() {
/** Custom Keybinding: Map named actions to inputs. */ private void initKeys() { /** You can map one or several inputs to one named mapping. */ inputManager.addMapping("Pause", new KeyTrigger(keyInput.KEY_P)); inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_J)); inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_K)); inputManager.addMapping("Rotate", new KeyTrigger(KeyInput.KEY_SPACE), // spacebar! new MouseButtonTrigger(MouseInput.BUTTON_LEFT) ); // left click! /** Add the named mappings to the action listeners. */ inputManager.addListener(actionListener,"Pause"); inputManager.addListener(analogListener,"Left", "Right", "Rotate"); }
/** * Sets up the keyboard bindings */ private void Keys() { inputManager.addMapping("START", new KeyTrigger(KeyInput.KEY_RETURN)); inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_LEFT)); inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_RIGHT)); inputManager.addListener(this, "START", "Left", "Right"); }
private void setupKeys() { inputManager.addMapping("Lefts", new KeyTrigger(KeyInput.KEY_H)); inputManager.addMapping("Rights", new KeyTrigger(KeyInput.KEY_K)); inputManager.addMapping("Space", new KeyTrigger(KeyInput.KEY_SPACE)); inputManager.addListener(this, "Lefts", "Rights", "Space"); }
public void registerInput() { inputManager.addMapping("moveForward", new KeyTrigger(keyInput.KEY_UP), new KeyTrigger(keyInput.KEY_W)); inputManager.addMapping("moveBackward", new KeyTrigger(keyInput.KEY_DOWN), new KeyTrigger(keyInput.KEY_S)); inputManager.addMapping("moveRight", new KeyTrigger(keyInput.KEY_RIGHT), new KeyTrigger(keyInput.KEY_D)); inputManager.addMapping("moveLeft", new KeyTrigger(keyInput.KEY_LEFT), new KeyTrigger(keyInput.KEY_A)); inputManager.addMapping("displayPosition", new KeyTrigger(keyInput.KEY_P)); inputManager.addListener(this, "moveForward", "moveBackward", "moveRight", "moveLeft"); inputManager.addListener(this, "displayPosition"); }
@Override public void simpleInitApp() { bulletAppState = new BulletAppState(); stateManager.attach(bulletAppState); bulletAppState.setDebugEnabled(true); inputManager.addMapping("Pull ragdoll up", new MouseButtonTrigger(0)); inputManager.addListener(this, "Pull ragdoll up"); PhysicsTestHelper.createPhysicsTestWorld(rootNode, assetManager, bulletAppState.getPhysicsSpace()); createRagDoll(); }
public void registerInput() { inputManager.addMapping("moveForward", new KeyTrigger(keyInput.KEY_UP), new KeyTrigger(keyInput.KEY_W)); inputManager.addMapping("moveBackward", new KeyTrigger(keyInput.KEY_DOWN), new KeyTrigger(keyInput.KEY_S)); inputManager.addMapping("moveRight", new KeyTrigger(keyInput.KEY_RIGHT), new KeyTrigger(keyInput.KEY_D)); inputManager.addMapping("moveLeft", new KeyTrigger(keyInput.KEY_LEFT), new KeyTrigger(keyInput.KEY_A)); inputManager.addMapping("toggleRotate", new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); inputManager.addMapping("rotateRight", new MouseAxisTrigger(MouseInput.AXIS_X, true)); inputManager.addMapping("rotateLeft", new MouseAxisTrigger(MouseInput.AXIS_X, false)); inputManager.addListener(this, "moveForward", "moveBackward", "moveRight", "moveLeft"); inputManager.addListener(this, "rotateRight", "rotateLeft", "toggleRotate"); }