To activate the mappings, you have to register them to an InputListener
object. The jMonkeyEngine offers several InputListener
objects in the com.jme3.input.controls.*
package. Let's create instances of the two most common InputListener
objects and compare what they do.
On class level, below the closing curly braces of the
simpleInitApp()
method, add the following code snippet:private ActionListener actionListener = new ActionListener() { public void onAction(String name, boolean isPressed, float tpf) { System.out.println("You triggered: "+name); } }; private AnalogListener analogListener = new AnalogListener() { public void onAnalog(String name, float intensity, float tpf) { System.out.println("You triggered: "+name); } };