How do I make a script work ONLY when a button is being held down

Ask gaming related questions (AHK v1.1 and older)
[Jeremy]
Posts: 3
Joined: 12 Mar 2018, 11:30

How do I make a script work ONLY when a button is being held down

13 Mar 2018, 17:19

Im not sure how to do this, could someone help?
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: How do I make a script work ONLY when a button is being held down

13 Mar 2018, 22:09

Use conditional hotkeys.

#If (GetKeyState("KEY", "P"))

Write the hotkeys you want to be triggered only when the key is pressed down here, below #If getkeystate.

Write
#If
again to end condition.
I am your average ahk newbie. Just.. a tat more cute. ;)
Shade4Real
Posts: 16
Joined: 16 Jun 2018, 00:54

Re: How do I make a script work ONLY when a button is being held down

16 Jun 2018, 02:42

$LButton:: ; change this to whatever you want to hold down
While getkeystate ("LButton","P") ; change this to the same as above
{
---- ; put the script that only runs when you hold the hotkey in these brackets
}
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 50 guests