LButton Up to hault loop

Get help with using AutoHotkey and its commands and hotkeys
a59x
Posts: 18
Joined: 03 Mar 2019, 19:10

LButton Up to hault loop

23 Jun 2019, 13:53

Hey everone, I have this script and it works as intended but my problem is that the script does not end when I life my finger up off the LButton.

Code: Select all

mem:=0

~$*LButton:: 
Sleep, 100
KeyWait, LButton, T0.10
If ErrorLevel = 1
   {
   While GetKeyState("LButton","P")

Loop {
GetKeyState, state, LButton, P
	If state = U
		Break

 MouseGetPos, xpos, ypos

 if (xpos > mem)          ;moved right
    {
     send, {a down}         ;send key
     mem:=xpos
    }
 else
     send, {a up}

 if (xpos < mem)          ;moved left
    {
     send, {d down}
     mem:=xpos
    }
 else
     send, {d up}

  Sleep, 100
}
}
return

INSERT::
Pause
tooltip
return
I just want to script to stop when LButton is up and work when LButton is down.

Return to “Ask For Help”

Who is online

Users browsing this forum: JawGBoi, loek6000, MikeKey, swagfag, vsub, Weshuggah and 278 guests