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 

Esc key remapping

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





PostPosted: Thu Jul 30, 2009 2:24 am    Post subject: Esc key remapping Reply with quote

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
Back to top
randallf



Joined: 06 Jul 2009
Posts: 678

PostPosted: Thu Jul 30, 2009 2:30 am    Post subject: Reply with quote

#IfWinActive, Firefox
Question
Back to top
View user's profile Send private message
emerysteele
Guest





PostPosted: Thu Jul 30, 2009 2:47 am    Post subject: ?? Reply with quote

I don't get it Question
Back to top
lilalurl.T32



Joined: 17 May 2007
Posts: 391
Location: Titan

PostPosted: Thu Jul 30, 2009 2:57 am    Post subject: Reply with quote

#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 Sun Mar 13, 2011 6:42 am; edited 1 time in total
Back to top
View user's profile Send private message
emerysteele
Guest





PostPosted: Thu Jul 30, 2009 3:03 am    Post subject: TY Reply with quote

Thanks man. That helps alot. Very Happy
Back to top
emerysteele



Joined: 30 Jul 2009
Posts: 36

PostPosted: Thu Jul 30, 2009 3:23 am    Post subject: Actually no Reply with quote

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.
Back to top
View user's profile Send private message
lilalurl.T32



Joined: 17 May 2007
Posts: 391
Location: Titan

PostPosted: Thu Jul 30, 2009 3:43 am    Post subject: Re: Actually no Reply with quote

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 Sun Mar 13, 2011 6:42 am; edited 1 time in total
Back to top
View user's profile Send private message
emerysteele



Joined: 30 Jul 2009
Posts: 36

PostPosted: Thu Jul 30, 2009 4:15 am    Post subject: Reply with quote

No that doesn't seem to work either.
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Jul 30, 2009 4:29 am    Post subject: Reply with quote

Code:
SetTitleMatchMode, 2
~esc::
IfWinActive, Firefox
send ^w
return
Back to top
emerysteele



Joined: 30 Jul 2009
Posts: 36

PostPosted: Thu Jul 30, 2009 4:38 am    Post subject: emerysteele Reply with quote

now it doesn't work at all
Back to top
View user's profile Send private message
Z_Gecko
Guest





PostPosted: Thu Jul 30, 2009 6:20 am    Post subject: Reply with quote

try:
Code:
#IfWinActive, ahk_class MozillaUIWindowClass
Esc:: Send, {Ctrl Down}{w}{Ctrl Up}
#IfWinActive
Back to top
emerysteele



Joined: 30 Jul 2009
Posts: 36

PostPosted: Thu Jul 30, 2009 6:25 am    Post subject: Reply with quote

Very Happy Yep. Thanx
Back to top
View user's profile Send private message
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