robot.mouseMove does not work?
in
Programming Questions
•
3 months ago
Hello
according to
http://wiki.processing.org/w/Robot_class should this code move the mouse to an initial position:
import java.awt.AWTException;
import java.awt.Robot;
Robot robot;
void setup() {
size(400, 400);
try {
robot = new Robot();
}
catch (AWTException e) {
e.printStackTrace();
}
robot.mouseMove(displayWidth/2, displayHeight/2);
}
void draw() {
//println(frameCount);
background(0);
stroke(255,0,0);
ellipse(mouseX,mouseY,100,100);
}
But mouseX and mouseY stay at 0,0.
Any idea whats wrong?
Thank you
Kjevle
1