AutoHotkey Community

It is currently May 26th, 2012, 11:58 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: October 1st, 2009, 7:22 am 
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...?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 1st, 2009, 8:17 am 
Offline

Joined: May 12th, 2005, 8:20 am
Posts: 331
Location: Münster, Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 1st, 2009, 10:49 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 1st, 2009, 10:52 am 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Then try the command
#IfWinNotactive,
Look for it in the help-file.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 1st, 2009, 1:45 pm 
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?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, hyper_, Leef_me, Pulover, RaptorX, rbrtryn, XstatyK, Yahoo [Bot] and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group