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 

IfWinActive - passing multiple ahk_classes? how to?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ewerybody



Joined: 18 Sep 2006
Posts: 20

PostPosted: Wed May 07, 2008 11:41 pm    Post subject: IfWinActive - passing multiple ahk_classes? how to? Reply with quote

Hi!

If I have a list of window classes, how would I assign the same hotkey to each of the classes?
I mean, I could loop it, but what If I want it to be IfWinNotActive?

Istn there a way to do something like:

Code:
Hotkey, IfWinNotActive, ahk_class CabinetWClass, ahk_class ConsoleWindowClass
Hotkey, $^#y, aRandomLabelName, On, T2
??

Maybe with Groups? I mean you can do that with window titles no problem, but why not with class names? That would be much more effective!
Back to top
View user's profile Send private message
sinkfaze



Joined: 18 Mar 2008
Posts: 139

PostPosted: Thu May 08, 2008 12:03 am    Post subject: Reply with quote

Is the same hotkey going to be doing the same thing in every program?
Back to top
View user's profile Send private message
ewerybody



Joined: 18 Sep 2006
Posts: 20

PostPosted: Thu May 08, 2008 8:00 am    Post subject: Reply with quote

yes of course!

And I tried groupAdd. It works quite good! But I'm asking myself is this is a little bit too much for this task... In terms of memory consumption and performance. As groups are much more than that.

But it works! Would be happy to hear if theres another way though. ;]
thx!
Back to top
View user's profile Send private message
sinkfaze



Joined: 18 Mar 2008
Posts: 139

PostPosted: Thu May 08, 2008 1:16 pm    Post subject: Reply with quote

Well if each of those windows is also going to have hotkeys unique to it as well as the common hotkey you can always set up individual #IfWinActive sections for each window and set up the hotkey itself with Gosub. I don't have the knowledge to tell you what that will mean in terms of memory usage, unfortunately.
Back to top
View user's profile Send private message
ewerybody



Joined: 18 Sep 2006
Posts: 20

PostPosted: Fri May 16, 2008 3:48 pm    Post subject: GroupAdd? Check! GroupSub? Err.... Reply with quote

OK I fixed this with groups!

But .. how to Remove classes from a Group? And is it possible to have a list of the content of a group? Or is that stuff for the wishlist?
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2737
Location: Australia, Qld

PostPosted: Sat May 17, 2008 12:32 am    Post subject: Reply with quote

Unfortunately, criteria cannot be removed from window groups. I believe it is on the wish list already. You must either reload the script or create and use a new group.

I wouldn't worry about memory usage - there is minimal overhead over the actual text (name of the group, window titles, etc.) You would need to create ridiculous numbers of window groups with many windows to impact memory noticeably. (Recreating groups repeatedly to "remove" criteria could be a concern.)
Back to top
View user's profile Send private message
ewerybody



Joined: 18 Sep 2006
Posts: 20

PostPosted: Sat May 17, 2008 9:04 am    Post subject: Reply with quote

Yea I currently let the script reload on class-remove. takes half a second.. thats ok.

Yea I'm not wondering about memory anymore.. ;]
should be ok as well. As groupAdd is Darn convenient!!

Is there a wishlist where I could look into for that? Or could append it?
Ah: http://www.autohotkey.com/forum/viewforum.php?f=4 ?
okok.. enough asking. I found it :]
http://www.autohotkey.com/forum/viewtopic.php?t=12119&start=0&postdays=0&postorder=asc
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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