First off : I'm using an azerty keyboard. I want to press the button which is in the upper left corner, just below 'escape'. I believe it's the '~' for qwerty keyboard (for azerty it is '²')
I unsuccesfully search for it's key code then I found this : java.awt.event.KeyEvent not capable of fully mappin AZERTY keyboard?
Running his code I got this :
Pressed : unknown keyCode: 0x0 / ² code = 0
By inspecting the keyEvent object while debugging I got this
extendedKeyCode = 16777394
keyLocation = 1
id = 401
How could I solve this problem? Do you think I could make my own Implementation of keyEvent, build one that is similar then raise it?
Thanks.
Well I just made a loop to press keyEvent from 0 to 10 000 000 and '²' was never pressed.
package keyCodeTester;
import java.awt.Robot;
import java.awt.event.KeyEvent;
public class KeyCodeTester {
public static void main(String args[]) throws Exception {
Robot robot = new Robot();
robot.delay(5000);
for(int i=41; i<10000000; i++) {
try {
if (i>=112 && i<=123) {
throw new IllegalArgumentException("touche fonction");
}
robot.keyPress(i);
robot.delay(100);
robot.keyPress(KeyEvent.VK_ENTER);
robot.delay(100);
} catch (IllegalArgumentException iae) {
System.out.println("iae pour " + String.valueOf(i));
}
}
}
}
I guess robot only works for qwerty. I'm going to make some C code and call it from java.