We have a user provided string that may contain unicode characters, and we want the robot to type that string.
How do you convert a string into keyCodes that the rob
The best way that i find when solve simulare problem
import java.awt.AWTException;
import java.awt.Robot;
public class MyRobot {
public static void typeString(String s)
{
try {
Robot robik = new Robot();
byte[] bytes = s.getBytes();
for (byte b : bytes)
{
int code = b;
// keycode only handles [A-Z] (which is ASCII decimal [65-90])
if (code > 96 && code < 123) code = code - 32;
robik.delay(40);
robik.keyPress(code);
robik.keyRelease(code);
}
} catch (AWTException e){
}
}
}
http://www.devdaily.com/java/java-robot-class-example-mouse-keystroke\