Are you sure that is the case?
Yes. On my Win2000 with Java JRE v1.42_02-b03 it's the case.
According to the Javadocs, pressing numpad4 when numlock is off should result in VK_KP_LEFT, not VK_LEFT.
Here it does result in VK_LEFT.
With numlock enabled, it results in VK_NUMPAD4.
The code VK_KP_LEFT I never receive.
EDIT: Ah, but then people are complaining that VK_LEFT is always returned, and never VK_KP_LEFT. Perhaps this is a lil bug in key events?
This I don't understand I'm afraid... :-)
PS: Maybe some people could confirm their keypad's keycode behaviour, please? (different JREs, maybe, different platforms?)
The code I use fo this is like the following, attached to a GLCanvas
1 2 3 4 5 6 7 8 9 10 11
| myGLCanvas.addKeyListener(new Listentome());
...
class Listentome implements KeyListener { public void keyPressed(KeyEvent eve) { int keycode = eve.getKeyCode(); } |