AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Input Endkey:F12 dosen't work in if else control flow

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
JCHT
Guest





PostPosted: Tue Dec 11, 2007 7:39 pm    Post subject: Input Endkey:F12 dosen't work in if else control flow Reply with quote

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

PostPosted: Tue Dec 11, 2007 9:11 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
JCHT
Guest





PostPosted: Tue Dec 11, 2007 10:42 pm    Post subject: Reply with quote

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





PostPosted: Tue Dec 11, 2007 10:44 pm    Post subject: Reply with quote

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





PostPosted: Thu Dec 13, 2007 2:14 pm    Post subject: Reply with quote

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

PostPosted: Fri Feb 29, 2008 2:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
halweg



Joined: 27 Jan 2005
Posts: 102
Location: Germany, Dresden

PostPosted: Tue Apr 08, 2008 10:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group