Hello,
I've looked around the wiki, the forum and some test class but i haven't found a solution at my problem:
i'm using KeyBindingManager for handling multiple keys (like up+left+shot+etc…) but i'm having a problem.
if the key pressed are more than 2 or 3, simply only the first 2 or 3 key pressed event are run.
for example if i press G+H+J then G and H code are executed, but not J. if I release G or H key, then the J code is executed. :?
Tips are welcome^^
Here my test class ( i call update() method every ~20ms )
import java.util.ArrayList;
import com.jme.input.KeyBindingManager;
import com.jme.input.KeyInput;
public class KeyReader{
public KeyReader(){
KeyBindingManager keyboard = KeyBindingManager.getKeyBindingManager();
keyboard.set("1asd", KeyInput.KEY_G);
keyboard.set("2asd", KeyInput.KEY_H);
keyboard.set("3asd", KeyInput.KEY_J);
keyboard.set("4asd", KeyInput.KEY_SPACE);
}
public void update() {
System.out.println("up");
if (KeyBindingManager.getKeyBindingManager().isValidCommand("1asd", true)) {
System.out.println("1_Tasto premuto!!!!!!!!");
}
if (KeyBindingManager.getKeyBindingManager().isValidCommand("2asd", true)) {
System.out.println("2_Tasto premuto!!!!!!!!");
}
if (KeyBindingManager.getKeyBindingManager().isValidCommand("3asd", true)) {
System.out.println("3_Tasto premuto!!!!!!!!");
}
if (KeyBindingManager.getKeyBindingManager().isValidCommand("4asd", true)) {
System.out.println("4_Tasto premuto!!!!!!!!");
}
}
}