user2821752
user2821752

Reputation: 23

AutoHotkey push a button to move curser to the left

I am struggling to make an AutoHotkey script, if anyone would help I would appreciate it. the script im trying to make is: if I pressed F my mouse would move to the left as long as im pushing the F button from the current location I had my mouse on. This is what I have right now and it's not working.

Loop { Sleep 10 MouseGetPos,x if (MouseMove, -1000, 0, 100, R) send {C down} else if {C up} break } return Esc::ExitApp

Upvotes: 2

Views: 5277

Answers (1)

Vladimir Sinenko
Vladimir Sinenko

Reputation: 4667

Try this:

f::MouseMove -5, 0, 50, R

50 is the speed, and the R letter means that the offset is relative to the current cursor position. You don't need the loop, as the pressed key will generate subsequent events on its own.

Upvotes: 2

Related Questions