KeyBinding and Special Keys


I used the example TestKeyBinding to understand the usage of key assignment in jme. What strikes me odd is the behaviour.

If I press "0" the output is as expected "You pressed 0.". If I press LShift + Zero the output is also as expected "You pressed shift+0.". If I press RShift + Zero the output is again "You pressed 0."

Is this behaviour correct?  :?

I expected the system not to do anything at all when pressing RShift + Zero. If this is the normal behaviour, would I have to "mark dead" all unneccessary combinations for a key?

Maybe I just missed a switch or used the wrong approach?

Also what do I have to do to get something like the regular "+" and not the one on numpad. I could not find the KEY_PLUS constant.

The following is the modification I made in TestKeyBinding:

[method update]

protected void update(float interpolation) {
   if (KeyBindingManager.getKeyBindingManager().isValidCommand("zero")) {
     text.print("You pressed 0.");
   if (KeyBindingManager.getKeyBindingManager().isValidCommand("shiftzero")) {
     text.print("You pressed shift+0.");

[method initSystem]

KeyBindingManager.getKeyBindingManager().set("zero", KeyInput.KEY_0);
int[] shiftCodes = {KeyInput.KEY_LSHIFT, KeyInput.KEY_0};
KeyBindingManager.getKeyBindingManager().set("shiftzero", shiftCodes);

Yes, this is the intended behaviour. And it even makes sense: Imagine you have a game where left control key is the "fire" button and you can walk around with a,s,w,d. Now you want to have different actions on a,s,w,d while left shift is down. Ignoring a,s,w,d while left control is pressed would hinder the player from moving while shooting…

There certainly are other situations where you want the different behaviour you described. I'd like a flag for it but currently you have to handle it programmatically.