Code: Select all
#SingleInstance Force
$a::
ToolTip, Tap B to disable B`, C to reload
Hotkey, $b, Disable_B, On
return
$b::
ToolTip, B enabled
Send, B
return
$c::
Reload
return
Esc::
ExitApp
return
Disable_B:
ToolTip, B disabled
return
Why does this happen with IfWinActive?
Code: Select all
#SingleInstance Force
DetectHiddenWindows, On
SetTitleMatchMode, 2
#IfWinActive, ahk_exe notepad.exe
$a::
ToolTip, Tap B to disable B`, C to reload
Hotkey, $b, Disable_B, On
return
$b::
ToolTip, B enabled
Send, B
return
$c::
Reload
return
Esc::
ExitApp
return
Disable_B: ; <--- B can not be disabled when there's IfWinActive
ToolTip, B disabled
return
#IfWinActive