I press AltGr in my Java application, but instead of getting KeyEvent with key code VK_ALT_GRAPH, I get two events. The first with key code VK_CONTROL, and the second with VK_ALT.
Is this the right behavior?
Using Java 7 on Windows 7. Can be played using the demo application found at http://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html
When I press AltGr, it reports:
KEY PRESSED:
key code = 17 (Ctrl)
extended modifiers = 128 (Ctrl)
action key? NO
key location: left
KEY PRESSED:
key code = 18 (Alt)
extended modifiers = 640 (Ctrl + Alt)
action key? NO
key location: right
KEY RELEASED:
key code = 17 (Ctrl)
extended modifiers = 512 (Alt)
action key? NO
key location: left
KEY RELEASED:
key code = 18 (Alt)
extended modifiers = 0 (no extended modifiers)
action key? NO
key location: right
source share