= Input Handling :revnumber: 2.0 :revdate: 2020/07/15 :keywords: keyinput, input, documentation Users interact with your jME3 application with different input devices – the mouse, the keyboard, or a joystick. To respond to inputs we use the `inputManager` object in `SimpleApplication`. This is how you add interaction to your game: . For each action, choose the trigger(s) (a key or mouse click etc) . For each action, add a trigger mapping to the inputManager . Create at least one listener in SimpleApplication . For each action, register its mappings to a listener . Implement each action in the listener == Code Samples * link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/input/TestControls.java[TestControls.java] * link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/input/TestJoystick.java[TestJoystick.java] == 1. Choose Trigger Choose one or several key/mouse events for the interaction. We use `KeyTrigger`, `MouseAxisTrigger`, `MouseButtonTrigger`, `JoyAxisTrigger` and `JoyButtonTrigger` constants from the `com.jme3.input.controls` package. [NOTE] ==== The MouseAxis and JoyAxis triggers go along the X axis (right/left) or Y axis (up/down). These Triggers come with extra booleans for the negative half of the axis (left, down). Remember to write code that listens to the negative (true) and positive (false) axis! ==== [cols="2", options="header"] |=== a| Trigger a| Code a| Mouse button: Left Click a| MouseButtonTrigger(MouseInput.BUTTON_LEFT) a| Mouse button: Right Click a| MouseButtonTrigger(MouseInput.BUTTON_RIGHT) a| Mouse button: Middle Click a| MouseButtonTrigger(MouseInput.BUTTON_MIDDLE) a| Mouse movement: Right a| MouseAxisTrigger(MouseInput.AXIS_X, true) a| Mouse movement: Left a| MouseAxisTrigger(MouseInput.AXIS_X, false) a| Mouse movement: Up a| MouseAxisTrigger(MouseInput.AXIS_Y, true) a| Mouse movement: Down a| MouseAxisTrigger(MouseInput.AXIS_Y, false) a| Mouse wheel: Up a| MouseAxisTrigger(MouseInput.AXIS_WHEEL,false) a| Mouse wheel: Down a| MouseAxisTrigger(MouseInput.AXIS_WHEEL,true) a| NumPad: 1, 2, 3, … a| KeyTrigger(KeyInput.KEY_NUMPAD1) … a| Keyboard: 1, 2 , 3, … a| KeyTrigger(KeyInput.KEY_1) … a| Keyboard: A, B, C, … a| KeyTrigger(KeyInput.KEY_A) … a| Keyboard: Spacebar a| KeyTrigger(KeyInput.KEY_SPACE) a| Keyboard: Shift a| KeyTrigger(KeyInput.KEY_RSHIFT), + KeyTrigger(KeyInput.KEY_LSHIFT) a| Keyboard: F1, F2, … a| KeyTrigger(KeyInput.KEY_F1) … a| Keyboard: Return, Enter >.