When I set my Robot to “setAutoWaitForIdle(true)” (so it cues the next event after the Robot stops), I get an “IllegalThreadStateException”…
What’s wrong ???
`
Robot mouseBot;
boolean RobotMove=true;
public void startMouseRobot(){
try{mouseBot=new Robot();}
catch(Exception e){}
mouseBot.setAutoWaitForIdle(true);
}
public void robotResetMouse(){
//set RobotMove to true
//move cursor
//set RobotMove to false
RobotMove=true;
mouseBot.mouseMove(screenSize.width/2, screenSize.height/2);
RobotMove=false;
}
`
(Im using the boolean RobotMove to determine the difference between a user mouse move and a robot mouse move. Is there another way to do this?)