Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.awt.Robot and VK_ALT_GRAPH: Invalid key code

843806Aug 18 2009 — edited Aug 19 2009
Hi,

I'm working on a virtual keyboard based on java.awt.Robot. I need to press AltGr key. But when I call this code:
robot.keyRelease(KeyEvent.VK_ALT_GRAPH);
I allways get this exception:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Invalid key code
	at sun.awt.windows.WRobotPeer.keyPress(Native Method)
	at java.awt.Robot.keyPress(Robot.java:243)
Any solution?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2009
Added on Aug 18 2009
6 comments
829 views