I have to work with a string standing for a keystroke (for instance "A", "ENTER", "F4"). From this string I need to get the keychar, the keycode and the key modifiers for the keystroke.
Here is what I do (for F4 for example) :
AWTKeyStroke ks = AWTKeyStroke.getAWTKeyStroke("F4");
System.out.println(ks.getKeyCode());
System.out.println(ks.getKeyModifiers());
System.out.println(ks.getKeyChar());
I get :
115
0
?
keycode and modifiers are OK but whatever keystroke I try I always get ? for the keychar ...
Am I missing something ?