Every time I use Robot to move the mouse, it resets the speed of the Windows mouse. This is really annoying, and I was wondering if anyone knew how to fix this. Here is basically the code I come across:
Robot robot = new Robot(); robot.mouseMove(10, 1070); robot.delay(300); robot.mousePress(InputEvent.BUTTON1_MASK); robot.mouseRelease(InputEvent.BUTTON1_MASK); robot.delay(300); robotType("notepad"); robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER); robot.delay(400); robotType("I am writing this.");
What does this mean, just click on the โStartโ button, enter โnotepadโ, open notepad, then enter โI am writing thisโ.
robotType () is just a quick function I made that converts a string into a sequence of keystrokes / releases of the keyboard.
source share