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 

disable a hotkey when in text mode

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






PostPosted: Thu Oct 01, 2009 6:22 am    Post subject: disable a hotkey when in text mode Reply with quote

How can I disable my hotkey when in text mode? I mean, if I set "A" to do something, I don't want it to work when I'm writting a text, because otherwise I cannot write any word with the "A" letter. Maybe there's a way I can tell my script to disable the hotkey when the mouse pointer is not in the pointer format...?
Back to top
Klaus



Joined: 12 May 2005
Posts: 325
Location: Münster, Germany

PostPosted: Thu Oct 01, 2009 7:17 am    Post subject: Reply with quote

Hi, Guest (a nice nick would be nice!),
try something like this and play around with it
Code:
SetTitleMatchMode, 2
Settimer, detectFocus, 3000 ; or a shorter cycle

Gui, Add, Edit, w100 h20
Gui, Add, Button, w100 h20, test-button
Gui, Show, w300 h100, Focus
return

detectFocus:
Gui, Submit, Nohide
ControlGetFocus, OutputVar , Focus  ,,
ifInString, OutPutVar, Edit ; or other controls, as you like it!
{
  MsgBox, It's an edit control`nso disable my "a"-hotkey
}
return

Hope I could help,
Klaus
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Thu Oct 01, 2009 9:49 am    Post subject: Reply with quote

Sorry that doesn't work.

My hot key does:

ç::
^w
winclose, a

but if I open the notepd, I cannot write the ç key without activating the hotkey.
Back to top
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Thu Oct 01, 2009 9:52 am    Post subject: Reply with quote

Then try the command
#IfWinNotactive,
Look for it in the help-file.
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Oct 01, 2009 12:45 pm    Post subject: Reply with quote

But... if notepad is active, the hotkey should close it, but not if the mouse pointer is in the text area. Same with explorer. If I click on the url field, the hotkey should not close the programa. Got it?
Back to top
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