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 

AHK_L: Key send from script not catched with #if conditions

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
fragman



Joined: 13 Oct 2009
Posts: 1194

PostPosted: Thu Feb 18, 2010 7:43 pm    Post subject: AHK_L: Key send from script not catched with #if conditions Reply with quote

I found a bug:

Code:
#if somecondition()
~LButton::         
   Send {Backspace}
   return
#if
#if somecondition()
Backspace::
msgbox blah
return
#if
somecondition()
{
   return true
}


Clicking will not show that message box for me. I believe I saw it appear once, but in atleast >90% of all cases it doesn't show up.
Tested with latest ANSI version.

[Moderator's note: Moved topic from Bug Reports to Ask for Help.]
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7295
Location: Australia

PostPosted: Thu Feb 18, 2010 9:32 pm    Post subject: Reply with quote

It's not a bug. #If, #IfWinActive, #IfWinExist, etc. hotkeys are typically implementing using the keyboard hook unless a global variant is defined and all defined variants are enabled. Hook hotkeys are not triggered by Send. For instance, LButton will not trigger the MsgBox:
Code:
GroupAdd, Everything
#IfWinActive ahk_group Everything
~LButton::Send {Backspace}
Backspace::msgbox blah
If you add this, it will:
Code:
#IfWinActive
~LButton::return
Backspace::return
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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