AutoHotkey Community

It is currently May 26th, 2012, 9:21 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Esc key remapping
PostPosted: July 30th, 2009, 3:24 am 
I have changed the Esc so that when in firefox it will close the current tab, but some applications like video games use the Esc key to exit the game and i don't know how to set it up like that. The code that i have is below.

Code:
Esc::
SetTitleMatchMode, 2
IfWinActive, Mozilla Firefox
   Send, {Ctrl Down}{w}{Ctrl Up}
Else
   Send, {Escape}
return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 30th, 2009, 3:30 am 
Offline

Joined: July 6th, 2009, 9:58 pm
Posts: 678
#IfWinActive, Firefox
:?:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: ??
PostPosted: July 30th, 2009, 3:47 am 
I don't get it :?:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 30th, 2009, 3:57 am 
Offline

Joined: May 17th, 2007, 6:03 pm
Posts: 391
Location: Titan
#IfWinActive / #IfWinExist:
Quote:
Creates context-sensitive hotkeys and hotstrings. Such hotkeys perform a different action (or none at all) depending on the type of window that is active or exists.


Hence:

Code:
SetTitleMatchMode, 2

#IfWinActive, Mozilla Firefox
Esc:: Send, {Ctrl Down}{w}{Ctrl Up}
#IfWinActive


should do what you want
________
WEBSITE HOST


Last edited by lilalurl.T32 on March 13th, 2011, 7:42 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: TY
PostPosted: July 30th, 2009, 4:03 am 
Thanks man. That helps alot. :D


Report this post
Top
  
Reply with quote  
 Post subject: Actually no
PostPosted: July 30th, 2009, 4:23 am 
Offline

Joined: July 30th, 2009, 4:15 am
Posts: 36
I thought it works, but it doesn't. It only works when it is an empty tab. It won't work when i have a site open.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Actually no
PostPosted: July 30th, 2009, 4:43 am 
Offline

Joined: May 17th, 2007, 6:03 pm
Posts: 391
Location: Titan
emerysteele wrote:
I thought it works, but it doesn't. It only works when it is an empty tab. It won't work when i have a site open.


Probably because the window title is changed from simply Mozilla Firefox to some text - Mozilla Firefox.

Have you put SetTitleMatchMode, 2 in the autoexecute (top) section of your script?
If that does not work, try SetTitleMatchMode, Regex. Hopefully, it should solve the issue.
________
Marijuana Vaporizers


Last edited by lilalurl.T32 on March 13th, 2011, 7:42 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 30th, 2009, 5:15 am 
Offline

Joined: July 30th, 2009, 4:15 am
Posts: 36
No that doesn't seem to work either.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 30th, 2009, 5:29 am 
Code:
SetTitleMatchMode, 2
~esc::
IfWinActive, Firefox
send ^w
return


Report this post
Top
  
Reply with quote  
 Post subject: emerysteele
PostPosted: July 30th, 2009, 5:38 am 
Offline

Joined: July 30th, 2009, 4:15 am
Posts: 36
now it doesn't work at all


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 30th, 2009, 7:20 am 
try:
Code:
#IfWinActive, ahk_class MozillaUIWindowClass
Esc:: Send, {Ctrl Down}{w}{Ctrl Up}
#IfWinActive


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 30th, 2009, 7:25 am 
Offline

Joined: July 30th, 2009, 4:15 am
Posts: 36
:D Yep. Thanx


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], wolverineks, Yahoo [Bot] and 68 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