JME2 keyboard input issue

I’m extending SimpleGame and using;

in my simpleInitGame;

[java]KeyBindingManager.getKeyBindingManager().remove(“Pause”);

KeyBindingManager.getKeyBindingManager().remove(“pause”);

KeyBindingManager.getKeyBindingManager().set(“Pause”, KeyInput.KEY_P);[/java]



and in my simpleUpdate;

[java]if(KeyBindingManager.getKeyBindingManager().isValidCommand(“Pause”, false)){

}[/java]



pressing P does NOTHING unless I change the passed boolean to true and then if i press P once it goes off seemingly for hundreds of instances… why?

Because you press it for more than one frame.

Let me be more specific; why doesn’t the P key work at all when the passed boolean is false?

I dont know, the javadoc says theres special things to do when you handle it that way:

http://jmonkeyengine.com/doc/com/jme/input/KeyBindingManager.html#isValidCommand(java.lang.String,%20boolean)