Reusing keys

Hi… several months ago i asked if i can bind one key to several actions in this way:



key 1 = action 1

key 2 = action 2

key 1 + key 2 = action 3



This is: key 1 does some action, key 2 does other action, and key 1 pressed at the same time with key 2 does another action.



The last time i asked, mojo (i guess) told me that he is looking at it, but the school was too much for me, and have to left what i was doing with jme… so… here i am again :slight_smile:

Yes, this led to a bit of revamping of the input system. We decided that if you pressed key 1 and key 2 for action 3, it would be impossible for the system to know you don’t want to do action 1 and action 2. So, when key 1 + key 2 is pressed: action 1, action 2 and action 3 will be called.



However, the addition that was made in the revamp, is the action methods now have the ability to determine what other keys are pressed, using the key press event class that is passed in. So, in your action 1 method you might check to make sure action 3 wasn’t called, if not perform the action, etc.