Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Robot to type a string 1

Status
Not open for further replies.

timmay3141

Programmer
Dec 3, 2002
468
US
I'm trying to use the Robot class to type a string. It doesn't seem like it should be difficult, but I can't figure out how to turn a char into a KeyEvent.VK_whatever, which is what Robot's keyPress method expects. I'm sure there is a very simple method of converting them, but I tried looking on google and couldn't find one. Any help would be appreciated.
 
Ahh, I didn't know that the ascii value was the same as the VK_. I got it working now by just turning the string into all caps and then using keyPress for each char in the string. Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top