"Click And Move" Help

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
RandomJK

"Click And Move" Help

15 Jan 2018, 12:49

Hey everyone, please help me with this.
I want to go back to the original position of my mouse after I left click. Here are some relevant lines:

Code: Select all

MouseGetPos, posx, posy
Click, Down
KeyWait, LButton, D
MouseMove, %posx%, %posy%
I can't move the mouse around until I left click. I want to be able to move around after `Click, Down`, until I left click, then move back to the original position
Thanks for any help!
User avatar
Spawnova
Posts: 554
Joined: 08 Jul 2015, 00:12
Contact:

Re: "Click And Move" Help

15 Jan 2018, 17:46

I'm not sure exactly what you were asking, but this code may help.

Code: Select all

coordmode,mouse,screen ;mouse is relative to screen

f1:: ;hotkey to hold lbutton down
mousegetpos,x,y
click,down
return

#if getkeystate("lbutton") ;since lbutton is held down, intercept left click
lbutton::
click,up
mousemove,x,y
return
#if ;set hotkey condition back to none

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: jameswrightesq, scriptor2016 and 264 guests