Basically I have made my own class of FlyByCamera and at one point I throw a boolean flag that I turn false,after doing some code, in the moveCamera method. The thing is when I lets say press FORWARD and LEFT it registers 1 key, then the other, so the boolean is set to false the first time, and stays false during the second time.
So what I was looking for was a way to access the event queue so I could know the amount of keys pressed, and set to false after executing moveCamera both, or more, times.
@madjack said:
Keep track of what keys are actually pressed.
[java]
if (key.equals("a") && pressed) {
aPressed = true;
} else if (key.equals("a") && !pressed) {
aPressed = false;
}[/java]
Somewhere else you could do:
[java]if (key.equals(“z”) && pressed && aPressed) {
// do something when z and a are both pressed
}[/java]
Thanks I was thinking about something like this last night, but you made me just realize that all I need to do is have a counter for the amount of keys pressed.
Also which “key” are you referring to above? a certain class? The only thing I see is “KeyInputEvent” but it seems this is for creating your own event to call?