Peter Banning
Peter Banning

Reputation: 27

AutoHotkey, MouseMove

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

Answers (2)

Andrio
Andrio

Reputation: 2078

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

Upvotes: 0

Tawnos
Tawnos

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

Related Questions