I'm having a weird issue. I'm trying to do some clicking with the robot class in java. All works fine except for when chrome is in focus. This is my method:
public static void click(int X, int Y) {
PointerInfo info = MouseInfo.getPointerInfo();
Point p = info.getLocation();
//robo.mouseRelease(InputEvent.BUTTON1_MASK);
robo.mouseMove(X, Y);
robo.mousePress(InputEvent.BUTTON1_MASK);
robo.mouseRelease(InputEvent.BUTTON1_MASK);
System.out.println("Clicked at X: "+X+" Y: "+Y);
//robo.mouseMove((int) p.getX(), (int) p.getY());
}
It just won't move or click when Chrome is focused. If I switch to notepad for example, it works.
Does Chrome have some kind of anti-macro stuff going on?
Thanks, have a nice day!