Hi!
I try to detect the keyboard layout (QWERTY, QWERTZ, AZERTY, DVORAK, etc…). I’m on Linux with an AZERTY keyboard and when I press the key “1” on the top of the keyboard (not the one on the numerical pad on the right side), the key code returned by KeyEvent.getKeyCode() is never VK_1, it returns VK_AMPERSAND. On a QWERTY keyboard, VK_AMPERSAND is on the same key than 7. I would like to use these keys as direct shortcuts to select a particular weapon like in Doom. JInput does not give a better result except if I press SHIFT and “1”. I know getExtendedKeyCode might be useful but it is only in Java 1.7. I could use the InputContext but I’m not sure a Locale is enough to know which keyboard layout is used.
Do you know a way of getting the keyboard layout?