Page 1 of 1

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

Posted: 13 Mar 2018, 17:19
by [Jeremy]
Im not sure how to do this, could someone help?

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

Posted: 13 Mar 2018, 22:09
by Nwb
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.

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

Posted: 16 Jun 2018, 02:42
by Shade4Real
$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