Simulate click event using Robot

Robot bot = null;
try {
bot = new Robot();
} catch (Exception failed) {
System.err.println("Failed instantiating Robot: " + failed);
}

Thread.sleep(10200);
while (true) {
int mask = InputEvent.BUTTON1_DOWN_MASK;
bot.mouseMove(386, 719);
bot.mousePress(mask);
bot.mouseRelease(mask);
Thread.sleep(10200);
}

你可能感兴趣的:(event)