2
votes

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

2
Hello, welcome to stack. Make your title shorter and explain your problem in the post.Stepo

2 Answers

6
votes

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
0
votes

This has already been answered, but just an FYI, make sure to use SendMode Input for instant mouse movements.