Code: Select all
Gosub, ~NumLock
SoundPlay, ""
Return
~NumLock::
NNLState := !GetKeyState("NumLock","T") ;[Basis] ➤ Numlock Toggle
GetKeyState, NumState, NumLock, T
If NumState = D
{
Sleep, 150
SoundPlay, C:\AutoHotkey\AutoHotkey - Sound\Single_isolated_beacon (high).wav
Progress, B1 fs9 zh0, `nNumlock State is toggled On.`n`nPress 'Numlock' to default.`n, ,Numlock State, Segoe UI
}
else
{
Sleep, 150
SoundPlay, C:\AutoHotkey\AutoHotkey - Sound\Single_isolated_beacon (low).wav
Progress, Off
}
return
I have many other hotkeys with KeyWait, 'key-name', T0.2: only triggers after key is hold down for T0.2.
Im just wondering, if its possible to apply it to Numlock?
Below was just for a try.
Code: Select all
Gosub, ~NumLock
SoundPlay, ""
Return
~NumLock::
KeyWait, NumLock, T0.2 ;[Basis] ➤ Numlock Toggle
If (ErrorLevel)
{
NNLState := !GetKeyState("NumLock","T")
GetKeyState, NumState, NumLock, T
If NumState = D
{
Sleep, 150
SoundPlay, C:\AutoHotkey\AutoHotkey - Sound\Single_isolated_beacon (high).wav
Progress, B1 fs9 zh0 W210, `nNumlock State is toggled On.`n`nPress 'Numlock' to default.`n, ,Numlock State, Segoe UI
}
else
{
Sleep, 150
SoundPlay, C:\AutoHotkey\AutoHotkey - Sound\Single_isolated_beacon (low).wav
Progress, Off
}
KeyWait, NumLock
}
else
{
Progress, B1 ZH0 fs9 H25 W110 CWFFFFFF, Cut to clipboard, , , Segoe UI ;~
Sleep, 600
Progress, Off
}
return
I tried several other arrangements, but can't get it to work.