问题
When using Robot.keyPress
for the KeyEvent VK_UP
, the numpad key is triggered rather than the normal arrow key.
I am trying to write a keyboard emulator that can be used for games etc. Testing with TrackMania I notice that it does not trigger the normal key, but the key on the numpad.
How can I trigger the normal keys using keyPress?
Checking the API, it is supposed to be the non-numpad arrow key. Which it isnt.
Robot r = new Robot();
r.keyPress(KeyEvent.VK_UP);
This will generate the numpad up key.
If this cannot be done in Java, is there any language that allows it?
来源:https://stackoverflow.com/questions/12565510/java-keypress-arrow-keys-triggers-numpad-keys