hi, in flag rush tut I found an interesting code
KeyBindingManager.getKeyBindingManager().set("exit",
KeyInput.KEY_ESCAPE);
…
if (KeyBindingManager.getKeyBindingManager().isValidCommand("exit")) {
finished=true;
}
so if one press esc the program will quit.
now I want to make a key combo, like esc + a for example, and the the game will quit
how can I do it?
I tried
KeyBindingManager.getKeyBindingManager().set("exit",
(KeyInput.KEY_ESCAPE&KeyInput.Key_A)); &&,and, and so on but it didnt work.
I think I found the solution
http://www.jmonkeyengine.com/doc/com/jme/input/KeyBindingManager.html
KeyBindingManager.getKeyBindingManager().set("down",KeyInput.KEY_DOWN); // 1 key
KeyBindingManager.getKeyBindingManager().set("up",/an array here/); // more key
but how can I create an array there ?
can someone show me an example ? (like KeyInput.KEY_DOWN + KeyInput.KEY_UP at the same time)
int[] keyCodes = {KeyInput.KEY_LSHIFT, KeyInput.KEY_I};
manager.set("Combo", keyCodes);
there it is... if you have anymore questions..try consulting jmetest.input.TestKeyBinding.java.... :D
Hi, I'm back with the same question again.
this time I use jme3 and how can I have 2 or more keyinput at the same time?
inputManager.registerKeyBinding("hide", KeyInput.KEY_MINUS); // 1 key input like in jme3 tut 5
keyCodes = {KeyInput.KEY_LSHIFT, KeyInput.KEY_I};
inputManager.registerKeyBinding("sdgasd", keyCodes); // just doesnt work