Search code examples
javawindows-10awtrobot

Robot mousePress not working on ''always on top'' programs (windows 10)


I have a program that sends mouseclicks like this:

robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);

This works great except on programs that are always on top, like the windows on screen keyboard.

With these programs the minimize, maximize, and close buttons don't respond to clicks. I've tried to add a small delay before the release without succes


Solution

  • Turns out that the windows on screen keyboard always runs as admin so in order to click it my program needed admin rights too.