AutoHotkey Community

It is currently May 26th, 2012, 11:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: November 13th, 2008, 4:25 am 
Offline

Joined: November 13th, 2008, 4:01 am
Posts: 10
I'm very new to AHK - I've made a few convenient scripts for myself but that's it. What I'm trying to do now is make a hotkey that will close the active tab if I'm in firefox, but outside of firefox it will close the window.

If possible, I want to be able to get the hotkey to be LButton, RButton, and !left. (!left is mapped to one of my mouse buttons) For all of the trial and error I've done so far though, I've just used ^q as my hotkey.

My major problems are figuring out how to map my preferred hotkey combination and get it to work, and how to get AHK to use that hotkey for one thing in firefox and another otherwise. If anyone can help, or even flat-out write a working script, I would be really grateful. I'll post what I have so for if you guys think it would help, but I really don't have anything yet that is even close to working.

Thanks in advance!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2008, 8:49 am 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Check out the #IfWinActive command.

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2008, 12:27 pm 
Offline

Joined: August 14th, 2006, 11:54 am
Posts: 163
Location: CPH
To get you started it could look something like this:

Code:
#IfWinActive, ahk_class MozillaUIWindowClass
NumpadAdd::^+
Return
#IfWinActive


Meaning that plus on the numpad will send ctrl +, but only in Firefox

Good Luck and you can use AutoItWindow Info Spy to get info on windows


:)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, BrandonHotkey, Exabot [Bot], Google Feedfetcher, Yahoo [Bot] and 52 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