Robot - keyPress(KeyEvent ke)
Hello!
I'm trying to copy some text from another application.
First I move the mouse to the proper position, click into the text box and than press down the shift key and control key (and hold them down both), then is pressed the right arow key 7 times and ctrl and shift key are released. Than comes key commands for copying the text but my code doesn't marks the text!
Here's the code:
r.mouseMove(864, 198);
r.mousePress(InputEvent.BUTTON1_MASK);
r.mouseRelease(InputEvent.BUTTON1_MASK);
r.keyPress(KeyEvent.VK_CONTROL);
r.keyPress(KeyEvent.VK_SHIFT);
for (int i = 0; i < 7; i++){
r.keyPress(KeyEvent.VK_RIGHT);
r.keyRelease(KeyEvent.VK_RIGHT);
}
r.keyRelease(KeyEvent.VK_SHIFT);
r.keyRelease(KeyEvent.VK_CONTROL);
// r is instance of a Robot class
Thanks for future help!
Tilen

