Currently to simulate mouse clicks in my application I use the Robot class of Java. It seems to use the desktop as bounds/grid for knowing where the Point maps out to on the screen.
Example:
Robot bot = new Robot();
bot.mouseMove(1099,22); //Manually collected point..
bot.delay(100);
bot.mousePress(InputEvent.BUTTON1_MASK);
bot.mouseRelease(InputEvent.BUTTON1_MASK);
Goal:
Robot forces my mouse/cursor to be used, I want to be able to do other things on my computer while this code runs doing clicks on only my Java application where I have programmed it to.
Is there a way to do this with JNA? Am not concerned to supporting any Operating System other then windows but still needs to be a Java application due to legacy technologies.
The following code clicks on the
target
Component at (x, y) relative totarget
.