Is it possible to create state dependent hotkeys with AutoHotKey? I know it is possible to create certain hotkeys in a dependent state when working with #IfWinActive but how about creating hotkeys inside a hotkey itself?
Example
F1::
Gui, Show, center center h500 w500, Just a window
return
F2::
MsgBox, 0, F2, You have pressed F2 inside the F1 hotkey
return
return
The problem here is that F2 is not state dependent and will trigger as soon as you press it.
Possible solution
F1::
state := true
Gui, Show, center center h500 w500, Just a window
return
#If (state = true)
{
F2::
MsgBox, 0, F2, You have pressed F2 inside the F1 hotkey
return
}
GUIclose:
Gui, destroy
state := false
return
return
This is a possible solution and works very well. However, is there an easier solution to it than doing it this way?