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

[1046 byte] By [Funky_1321a] at [2007-11-27 7:30:26]
# 1
Sorry ... I should post this in awt section. Do not reply here, reply there please.
Funky_1321a at 2007-7-12 19:10:39 > top of Java-index,Java Essentials,Java Programming...