Answers for "ahk Toggle hotkey"

0

ahk Toggle hotkey

; old way
toggle := 0
;%A_ThisHotkey%M:=0
F1::
F2::
SoundBeep
%A_ThisHotkey%M ^= 1
if %A_ThisHotkey%M
MsgBox, This only shows when toggle is 1
Else
%A_ThisHotkey%M:=toggle
return

;new way
F3::
F4::
KeyNo:= RegExReplace(A_ThisHotkey, "\D")
if (%A_ThisHotkey%:= !%A_ThisHotkey%)
Tooltip, % A_ThisHotkey "on",,, KeyNo
Else
Tooltip, % A_ThisHotkey "off",,, KeyNo
Return
Posted by: Guest on July-06-2021

Browse Popular Code Answers by Language