Hold down a key as long as I'm holding down a mouse button Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
zakirbaig
Posts: 3
Joined: 26 Dec 2018, 01:33

Hold down a key as long as I'm holding down a mouse button

26 Dec 2018, 01:43

I want my LShift to be held down as long as I'm holding down my MButton. I wrote the script mentioned below but what it does is locks the LShift key down and does not release it even after I let go of my MButton. Where am I going wrong?

MButton::
Loop {
Send {LShift down}
}Until !GetKeyState("MButton","P")
Return
CyL0N
Posts: 211
Joined: 27 Sep 2018, 09:58

Re: Hold down a key as long as I'm holding down a mouse button  Topic is solved

26 Dec 2018, 03:51

Code: Select all

MButton::
Send {Shift down}
While GetKeyState(A_ThisHotkey, "P")
	Sleep 10
Send {Shift up}
Return
live ? long & prosper : regards
zakirbaig
Posts: 3
Joined: 26 Dec 2018, 01:33

Re: Hold down a key as long as I'm holding down a mouse button

27 Dec 2018, 22:28

Thanks, bud. It worked. Also go the logic. :D

Return to “Ask For Help”

Who is online

Users browsing this forum: BeSu, just me, mikeyww, Netocon, SirSocks, SteveTranslator, teadrinker, WOlfen and 64 guests