Reputation: 27
In AutoHotkey, I want to click my mouse at position X,Y where X and Y are known but then I want it to return to the original position (arbitrary)
Right now I just have:
f::
Click 987,851
MouseMove,661,506
return
I would like to replace the 3rd line with a new method that returns it to the original position
Thanks
Upvotes: 3
Views: 4382
Reputation: 2078
This has already been answered, but just an FYI, make sure to use SendMode Input
for instant mouse movements.
Upvotes: 0
Reputation: 1887
You need to use MouseGetPos
to save the previous position, then restore it.
I think this should do it:
f::
MouseGetPos,xpos,ypos
Click 987,851
MouseMove,%xpos%,%ypos%
return
Upvotes: 7