2010-05-14

organize AutoHotKey code by app instead of key?

is there a way to organize ahk code so that it's grouped by application instead of keys?

for example, here's one block of code from my ahk script. It sets the * key on numpad, what it actually do depends on which app is front.

[code]
;;; make the numpad star “*” key to do next tab
$NumpadMult::
WinGet, myProcName, ProcessName, A
If (WinActive("ahk_class Second Life") Or WinActive("ahk_class Vertical Life") )
{
Send !{Right}
}
Else If (WinActive("ahk_class Emacs")
Or WinActive("ahk_class Chrome_WindowImpl_0")
Or WinActive("ahk_class MozillaUIWindowClass")
Or WinActive("ahk_class gdkWindowToplevel") )
{
Send ^{PgDn}
}
Else If (WinActive("ahk_class IEFrame")
Or WinActive("ahk_class OpWindow")
or (myProcName = "safari.exe") )
{
Send ^{Tab}
}
Else {
Send {NumpadMult}
}
Return
[/code]

so my ahk script is a bunch of such blogs.
It is easy to find all the definitions of a given key, but i'd like to find all hotkeys of a given app.

Thanks.

xah's ahk tutorial

post url http://www.autohotkey.com/forum/viewtopic.php?p=355260

No comments:

Post a Comment