Removed enableBuffer, since it apparantly included in the core, but getEventCharacter does not return any characters now. I did not change anything but remove the enableBuffer. What did I do wrong?
Appears to return a space/blank for me.
anyone?
OS? Does org.lwjgl.test.input.KeyboardTest work for you?
- elias
OS? Does org.lwjgl.test.input.KeyboardTest work for you?
- elias
OS is Win 2k.
Here is the result of the Keyboard test:
Checking key:E
Key character: e
NUM lock on
Checking key:E
Key character:
NUM lock on
Checking key:E
Key character: e
NUM lock on
Checking key:E
Key character:
NUM lock on
It appears that the capture took place ont he press and not the release.
Here is how I was doing it in 0.92
// poll keyboard to get key press/type, not jsut down state
Keyboard.poll();
//System.out.println("Event count: " + Keyboard.getNumKeyboardEvents());
while (Keyboard.next()) {
boolean keyPressed = Keyboard.getEventKeyState();
Manager.processKeyType(keyPressed, Keyboard.getEventKey(), Keyboard.getEventCharacter() );
// for testing
if (!keyPressed && Keyboard.getEventKey() == Keyboard.KEY_S) { // && state == PLAYING
//s key was released
System.out.println("Key: " + Keyboard.getEventCharacter());
}
}
This method returns a space now instead of a letter character. The letter āsā is missing like so:
Key:
EDIT: ok, so this tells me that getEventCharacter only returns a character when keyPressed above is true. Guess this has changed with this release and I missed it in the change log.