permaculture playing cards*
The moose likes Java in General and the fly likes Java Robot - how to press the keypad enter key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Robot - how to press the keypad enter key" Watch "Java Robot - how to press the keypad enter key" New topic
Author

Java Robot - how to press the keypad enter key

Adrian Burlington
Ranch Hand

Joined: Jun 16, 2009
Posts: 75
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

Joined: Oct 27, 2005
Posts: 19651
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Adrian Burlington
Ranch Hand

Joined: Jun 16, 2009
Posts: 75
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

Joined: Oct 27, 2005
Posts: 19651
    
  18

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.
 
 
subject: Java Robot - how to press the keypad enter key
 
Similar Threads
About java.awt.Robot
Java Robots problem
How to set focus on submit button on press of enter key
set the cursor back to top in a TextArea
How to parse this xml response from server -- tag Data1 is repeating itself?