Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Robot - how to press the keypad enter key

 
Adrian Burlington
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I'm writing a Robot and wonder what is the command to press Enter (the key on the very right side, not the Enter above the shift).
The reason for this is because I have an application that the Enter (or Return) is only by the very right enter key.

Thanks!




image here

 
Rob Spoor
Sheriff
Pie
Posts: 20533
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Odd. There should be absolutely no difference between both enter keys. I don't think any program that doesn't hook directly into the keyboard drivers will notice a difference between the two.
 
Adrian Burlington
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The program that I'm using (the external one) the most right enter key is ENTER (or RETURN) and the one above the shift is NEW LINE.

 
Rob Spoor
Sheriff
Pie
Posts: 20533
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not for Java. Run the following program, and press all the keys you want to see how Java sees them:
A little testing shows that it does recognize the difference between the keys on the numeric keypad and the matching keys on the rest of the keyboard when numlock is active, it doesn't see a difference between:
- left and right shift
- left and right control
- left and right alt
- "regular" enter and keypad enter
- "regular" insert and keypad insert
- "regular" delete and keypad delete
- "regular" home and keypad home
- "regular" end and keypad end
- "regular" page up and keypad page up
- "regular" page down and keypad page down

If your other program does it recognize these differences it uses a lower-level technique of finding the differences.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic