 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
JCHT Guest
|
Posted: Tue Dec 11, 2007 7:39 pm Post subject: Input Endkey:F12 dosen't work in if else control flow |
|
|
| Code: |
#z::
Input, t, , {F12}{F11}
if ErrorLevel = Endkey:F12
MsgBox, t F12
else if ErrorLevel = Endkey:F11
MsgBox, t F11
return
return
|
i post a simple test code to see if anyone have the same problem
thanks |
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 753 Location: London, UK
|
Posted: Tue Dec 11, 2007 9:11 pm Post subject: |
|
|
This code works perfectly for me, apart from the t wasnt in percent signs.
If you are using longer code than just the msgboxes the problem could be lack of {} within the ifs
SO
| Code: | #z::
Input, t, , {F12}{F11}
if ErrorLevel = Endkey:F12
{
MsgBox, t F12
}
else if ErrorLevel = Endkey:F11
{
MsgBox, t F11
}
return |
_________________ Steve F AKA Superfraggle
http://r.yuwie.com/superfraggle |
|
| Back to top |
|
 |
JCHT Guest
|
Posted: Tue Dec 11, 2007 10:42 pm Post subject: |
|
|
| Quote: |
#z::
Input, x, T5, {F12}{F11}
if ErrorLevel = Timeout
{
MsgBox, %x% Timeout
}
else if ErrorLevel = Endkey:F12
{
MsgBox, %x% F12
}
else if ErrorLevel = Endkey:F11
{
MsgBox, %x% F11
}
return
F12::MsgBox, only F12
F11::MsgBox, only F11
|
when F12 and F11 all remapping the other function but only F12 didn't work in #z:: for me
check this again see if that's relly a bug or only a problem for me
thanks |
|
| Back to top |
|
 |
JCHT Guest
|
Posted: Tue Dec 11, 2007 10:44 pm Post subject: |
|
|
sorry post the code above again
| Code: |
#z::
Input, x, T5, {F12}{F11}
if ErrorLevel = Timeout
{
MsgBox, %x% Timeout
}
else if ErrorLevel = Endkey:F12
{
MsgBox, %x% F12
}
else if ErrorLevel = Endkey:F11
{
MsgBox, %x% F11
}
return
F12::MsgBox, only F12
F11::MsgBox, only F11
|
|
|
| Back to top |
|
 |
JCHT Guest
|
Posted: Thu Dec 13, 2007 2:14 pm Post subject: |
|
|
These days I keep trying different keyboards and make me think of it might not a problem of my side.
the code did work fine as Superfraggle said when i delet all the other codes and leave only this part
| Code: |
#z::
Input, x, T5, {F12}{F11}
if ErrorLevel = Timeout
{
MsgBox, %x% Timeout
}
else if ErrorLevel = Endkey:F12
{
MsgBox, %x% F12
}
else if ErrorLevel = Endkey:F11
{
MsgBox, %x% F11
}
return
|
but for simulate my situation i simply remapped F11 and F12 to do something
| Code: |
#z::
Input, x, T5, {F12}{F11}
if ErrorLevel = Timeout
{
MsgBox, %x% Timeout
}
else if ErrorLevel = Endkey:F12
{
MsgBox, %x% F12
}
else if ErrorLevel = Endkey:F11
{
MsgBox, %x% F11
}
return
F12::MsgBox, only F12
F11::MsgBox, only F11
|
and the problem shows up again, which is only F12 will shows no responce and result a ErrorLevel = Timeout output.
Hope this find out can help AutoHotKey to improve the software.
And thanks for the trying, Superfraggle. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10450
|
Posted: Fri Feb 29, 2008 2:54 pm Post subject: |
|
|
Sorry for the late reply.
I can see that F12 behaves differently from other keys in this example. I seem to remember that F12 is reserved by the OS as a debugger key, at least under some configurations. That explains why ListHotkeys shows F12 to be a hook hotkey (because the OS refused to allow it to be registered as a normal hotkey), but other function keys are normal/registered hotkeys. This in turn explains why the Input command behaves different: it's documented that hook hotkeys (but not normal hotkeys) can be triggered during an Input.
Since there is nothing special about F12 in the AutoHotkey source code, there's no obvious way to fix this. However, it's good that you reported it in case anyone else has the same issue. |
|
| Back to top |
|
 |
halweg
Joined: 27 Jan 2005 Posts: 102 Location: Germany, Dresden
|
Posted: Tue Apr 08, 2008 10:03 pm Post subject: |
|
|
This seems to be the same problem: | Code: | #7::
SEND, {F11}
MSGBOX, F11 sent
RETURN
F11::MSGBOX, F11 received
#8::
SEND, {F12}
MSGBOX, F12 sent
RETURN
F12::MSGBOX, F12 received - doesn't happen, F12 goes direct to the GUI
|
Not a big problem, but good to know. _________________
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|