I was wondering if it is possible to make a toggle script with if statement. I press the Lbutton 2 times and it turns on/off the hotkeys. I already have another hotkey that also unsuspends hotkeys, which I press sometimes. So, Is it possible to check whether "suspend " is already on or off and make the toggle script act based on this statement?
I tried using the If (A_IsSuspended). Doesn't work or maybe I don't know how to use it. My code is below.
Code: Select all
~LButton::
Suspend, Permit
If (A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 200)
if (Toggle := !Toggle)
{
SoundBeep, 1000
Suspend, On
}
else
{
Suspend, Off
Sleep, 150
SendInput {Esc}
SoundBeep, 2100
}
return