Hi!
Is it possible to detect the AltGr (right alt) key from
Java?
Running this program with JRE 1.6.0_15 on Windows XP gives two codes when AltGr is pressed: CTRL and ALT
KeyEvent.isAltGraphDown() always returns false.
The program is
http://java.sun.com/docs/books/tutorialJWS/uiswing/events/ex6/KeyEventDemo.jnlp
Note: US keyboard layout generates ALT code when the right alt is pressed. Switch the OS keyboard layout setting to German or Slovenian.
I wonder, as currently AltGr appears to be detected as ctrl+alt. That gives problems in Eclipse, because this happens:
(keyboard layout is set to "Slovenian")
- user presses AltGr+W in editor to get the pipe "|" character (this normally works in other non-java programs)
- Eclipse/Java sees ctrl-alt-W
- Eclipse uses the shortcut defined for ctrl-alt-W (mapped to show SVN properties view)
- "|" does not appears in editor
Ideally the ctrl,alt and W keys would trigger that SVN property, while AltGr,W would type |.
Using that
test program above gives the impression the Java programs can not detect in the ctrl+alt code comes from those both keys or from the AltGr key.
Or is there a way?
Regards,
David