keyCode for Robot class

Hello

this java forum is something new to me. I had already found great help by browsing through other topics but this is the only time I haven't found any answer to this question.

I am trying to use the robot class to write strings, the quickest way I thought of would be to convert this string to a character array and to convert those to keyCode integers, but I have no idea how to do this.

Is it possible to pass a character through a method to obtain it's keyCode without having to write the whole list of "KeyEvent.VK_A"s for example and associating each character to one of those KeyEvent fields?

I don't know exactly what those keyCodes are, I haven't really found any support in the API and when i try to print KeyEvent.VK_A for example, it doesn't print anything. I've also tried to pass integers from 0 to 500000 to the KeyPress method of the robot class but it doesn't press anything..

Maybe there's a simple way to do it or it's too obvious, but I really haven't found any answer to this until now. I'm kind of new to Java so if I have made a mistake please correct me.

Thank you

[1146 byte] By [vILa] at [2007-11-26 22:47:39]
# 1
Look through the methods of the [url= http://java.sun.com/j2se/1.5.0/docs/api/index.html]KeyEvent[/url] class. You might be able to do something with setKeyChar() and getKeyCode().
CaptainMorgan08a at 2007-7-10 12:06:43 > top of Java-index,Desktop,Core GUI APIs...
# 2
Mmmh I have considered this, but I couldn't find any way to simulate a Key press with only a character and no actual key press. I'll continue searching..
vILa at 2007-7-10 12:06:43 > top of Java-index,Desktop,Core GUI APIs...