So I'm currently working my way through openGL tutorials, using LWJGL to do all my work in. However as I get to the part on how to access Keyboard and Mouse events in this library, I stumble across this little gem:
public static void poll()
Polls the keyboard for its current state. Access the polled values using the isKeyDown method. By using this method, it is possible to "miss" keyboard keys if you don't poll fast enough... (from http://www.lwjgl.org/javadoc/org/lwjgl/input/Keyboard.html#poll())
So in order to make use of Buffered Input (as the top answer in LWJGL multiple keyboard/mouse input checks calls it) you have to use this poll() method.
This means that no matter what I do, I will miss key presses if I use LWJGL for this. I have made a test with this bit of code:
while(Keyboard.next()) {
int character = Keyboard.getEventCharacter();
int key = Keyboard.getEventKey();
String charName= Keyboard.getKeyName(key);
System.out.println(charName+""+character);
}
When pressing the buttons Z X C V at the same time, an example output is as follows: Z122 V118 X120 C0 V0 Z0
As you can see the C press and X release aren't found in the buffer. In some cases a single keystroke had both the press and release missing from the buffer.
I need this to not be the case and polling faster doesn't solve the issue at all (why would that even be a solution?). So what are the alternatives for this system?
(P.S. Yes pressing those 4 buttons at the same time was properly recorded in other applications)