Search code examples
g1ant

mouse.click command works in loop?


When I run this program, it every time works in five steps or loops between defined mouse position or you can five breaking points. I am not using any loop and between every break, it waits for 5 secs which I had defined in mousedelay. Even no change is observed when in line 3 I changed type down to type up. Can someone explain how this robot is working?

keyboard ⋘WIN+D⋙
mouse.click 338⫽36 relative false type down  
mouse.click 1878⫽972 relative false type down mousedelay 5000

Solution

  • mouse.click command doesn't make a mouse move smoothly. It moves, then stops, it moves, then stops as you have noticed. It is a desired behaviour as it simulates a user and it lets you choose the time between each mouse moves happen.

    Of course, there is a change when you have type down instead of type up in the last line. Notice that when the script stops and you move the mouse, you move the selection on the desktop. If the mouse is "up", it means that the left mouse button is not pressed.