Johnydep
Johnydep

Reputation: 6277

Key code for <> signs for java robot class?

can you tell me the keycodes for Java Robot class.
For example, to press Enter we use:

   a.keyPress(KeyEvent.VK_ENTER);
   a.keyRelease(KeyEvent.VK_ENTER);  

I want to press these sysmbols > and < sign. What keyword or code should i use?
Thank you.

Upvotes: 0

Views: 8303

Answers (3)

Yamikuronue
Yamikuronue

Reputation: 758

You'll need to do a VK_SHIFT press event, followed by a VK_COMMA press, then a VK_COMMA release and a VK_SHIFT release (assuming QWERTY keyboard). The system will reject a VK_LESS press because that's not a valid key without a shift event.

Upvotes: 0

user unknown
user unknown

Reputation: 36250

Did you try VK_LESS, and VK_LESS in combination with SHIFT for >?

Upvotes: 1

matt b
matt b

Reputation: 139971

Assuming you mean java.awt.event.KeyInput, then a quick glance at the documentation suggests that KeyInput.VT_LESS and KeyInput.VT_GREATER would correspond to the < and > keys.

Upvotes: 3

Related Questions