Key input actions fire on key press and release?

I did this input action like i've seen it done in JmePhysics2:


final InputAction fireAction = new InputAction() {

yes, this is intended behavior. you can probably use evt.getTriggerPressed() to figure out if it is a keypress or release.

Ok, i read the wiki on inputhandlers (should have done that earlier) and it works as i expect when i add the action like this:


InputAction buttonAction = new InputAction() {
            public void performAction( InputActionEvent evt ) {
                bt.fire(camNode.getLocalRotation(), 100000f);
            }
        };
KeyBindingManager keyboard = KeyBindingManager.getKeyBindingManager();
keyboard.set("fire", KeyInput.KEY_SPACE);
input.addAction(buttonAction , "fire", false);


but that other input.addAction(xxx) now seems inconsistent to me.
how do You know it's intended  BTW ?

Sometimes you need to know when the key is released because you want to have something to last as long as the key is down without calling it each frame… what's wrong with it? Simply insert that condition drfugly posted if you want to know key-down only.

Nothing wrong with it as i still can use the other method, i just didn't find it documented.