开发者

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.


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜