| View previous topic :: View next topic |
| Author |
Message |
ewerybody
Joined: 18 Sep 2006 Posts: 20
|
Posted: Wed May 07, 2008 11:41 pm Post subject: IfWinActive - passing multiple ahk_classes? how to? |
|
|
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 |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 139
|
Posted: Thu May 08, 2008 12:03 am Post subject: |
|
|
| Is the same hotkey going to be doing the same thing in every program? |
|
| Back to top |
|
 |
ewerybody
Joined: 18 Sep 2006 Posts: 20
|
Posted: Thu May 08, 2008 8:00 am Post subject: |
|
|
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 |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 139
|
Posted: Thu May 08, 2008 1:16 pm Post subject: |
|
|
| 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 |
|
 |
ewerybody
Joined: 18 Sep 2006 Posts: 20
|
Posted: Fri May 16, 2008 3:48 pm Post subject: GroupAdd? Check! GroupSub? Err.... |
|
|
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 |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2737 Location: Australia, Qld
|
Posted: Sat May 17, 2008 12:32 am Post subject: |
|
|
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 |
|
 |
ewerybody
Joined: 18 Sep 2006 Posts: 20
|
|
| Back to top |
|
 |
|