Now, I am studying about LWJGL.
And I wrote the sample code noted below.
while (Keyboard.next()) {
if (Keyboard.getEventKeyState()) {
if (Keyboard.getEventKey() == Keyboard.KEY_A) {
....
}
}
}
Now I have some questions.
Questin1:
I want to convert the return value of
getEventKey() into the ASCII code, directly.
Are there the function converting
org.lwjgl.input Keyboard.KEY_A,
org.lwjgl.input Keyboard.KEY_B etc into ASCII code?
If I need the function noted above, should I make the function by myself?
If you know the function, please tell me.
Questin2:
Why is the value of
org.lwjgl.input Keyboard.KEY_A not same as the value of ASCII code of "A".
If you know the background, please tell me.
-----
P.S
I use the forum , this time is first.
Is my usage valid?
:)
You can use the Keyboard.getEventCharacter() method to get the key as a char directly instead of using getKeyEvent().
To kappa.
Nice to meet you.
I try to use the function "getEventCharacter()", and my test program goes as planned.
Thank you for answering my questions.
Quote from: jediTofu on April 17, 2011, 16:42:39
This is probably the nicest post that I have ever read here.
Yeah, he's not yelling or complaining or insulting the LWJGL devs. He's actually friendly.
What a breath of fresh air. I think more people should be like him. :)