A while ago I reported that AHK refused such a code:
Code: Select all
F1::
F1:
MsgBox, hi
return
F2::
GoTo, F1
return
I was told by person from this forum it was normal because hotkey labels are also labels.
Ok, makes sense, but why does this code not work:
Code: Select all
mode = 1
F1::
mode++
if mode = 3
{
mode = 1
}
return
F3::
GoTo, mylabel
return
#if mode = 1
mylabel:
F2::
MsgBox, first mode
return
#if
#if mode = 2
mylabel:
F2::
MsgBox, second mode
return
#if
How can I get it work?
Is the only chance something like:
Code: Select all
mode = 1
F1::
mode++
if mode = 2
{
mode = 1
}
return
F3::
GoTo, mylabel
return
#if mode = 1
F2::
MsgBox, first mode
return
#if
#if mode = 2
F2::
MsgBox, second mode
return
#if
mylabel:
if mode = 1
{
MsgBox, first mode
}
if mode = 2
{
MsgBox, second mode
}
return
Cheers!