| View previous topic :: View next topic |
| Author |
Message |
emerysteele Guest
|
Posted: Thu Jul 30, 2009 2:24 am Post subject: Esc key remapping |
|
|
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
|
Posted: Thu Jul 30, 2009 2:30 am Post subject: |
|
|
#IfWinActive, Firefox
 |
|
| Back to top |
|
 |
emerysteele Guest
|
Posted: Thu Jul 30, 2009 2:47 am Post subject: ?? |
|
|
I don't get it  |
|
| Back to top |
|
 |
lilalurl.T32
Joined: 17 May 2007 Posts: 391 Location: Titan
|
Posted: Thu Jul 30, 2009 2:57 am Post subject: |
|
|
#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 |
|
 |
emerysteele Guest
|
Posted: Thu Jul 30, 2009 3:03 am Post subject: TY |
|
|
Thanks man. That helps alot.  |
|
| Back to top |
|
 |
emerysteele
Joined: 30 Jul 2009 Posts: 36
|
Posted: Thu Jul 30, 2009 3:23 am Post subject: Actually no |
|
|
| 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 |
|
 |
lilalurl.T32
Joined: 17 May 2007 Posts: 391 Location: Titan
|
Posted: Thu Jul 30, 2009 3:43 am Post subject: Re: Actually no |
|
|
| 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 |
|
 |
emerysteele
Joined: 30 Jul 2009 Posts: 36
|
Posted: Thu Jul 30, 2009 4:15 am Post subject: |
|
|
| No that doesn't seem to work either. |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Jul 30, 2009 4:29 am Post subject: |
|
|
| Code: | SetTitleMatchMode, 2
~esc::
IfWinActive, Firefox
send ^w
return |
|
|
| Back to top |
|
 |
emerysteele
Joined: 30 Jul 2009 Posts: 36
|
Posted: Thu Jul 30, 2009 4:38 am Post subject: emerysteele |
|
|
| now it doesn't work at all |
|
| Back to top |
|
 |
Z_Gecko Guest
|
Posted: Thu Jul 30, 2009 6:20 am Post subject: |
|
|
try: | Code: | #IfWinActive, ahk_class MozillaUIWindowClass
Esc:: Send, {Ctrl Down}{w}{Ctrl Up}
#IfWinActive |
|
|
| Back to top |
|
 |
emerysteele
Joined: 30 Jul 2009 Posts: 36
|
Posted: Thu Jul 30, 2009 6:25 am Post subject: |
|
|
Yep. Thanx |
|
| Back to top |
|
 |
|