To better communicate what I'm asking for, take this example from the (V2) documentation that uses functions/labels:
Code: Select all
HotIfWinActive "ahk_class Notepad"
Hotkey "^!c", "MyFuncForNotepad"
HotIfWinActive "ahk_class WordPadClass"
Hotkey "^!c", "MyFuncForWordPad"
HotIfWinActive
Hotkey "^!c", "MyFuncForAllOtherWindows"
I'm wondering why we can't simply do something like this instead?
Code: Select all
HotIfWinActive "ahk_class Notepad"
Hotkey "^!c", "^c" ; sends CTRL+C in notepad
HotIfWinActive "ahk_class WordPadClass"
Hotkey "^!c", "^+c" ; sends CTRL+SHIFT+C in WordPad
HotIfWinActive
Hotkey "^!c", "^+!c" ; sends CTRL+ALT+SHIFT+C in all other windows
In my specific situation, I need to specify multiple conditions for each hotkey (which app is focused, and which custom joystick modifiers are down), and also have some of the conditions fall back on each other (or inherit from each other), so using #If (or #HotIf) will not work so well (will be difficult to allow app-specific remaps to inherit some keys from non-app-specific remaps).
Lastly, I read something about the "fat arrow" or => in the docs. I didn't completely understand it, but it almost seemed like some sort of function inlining. Would it be possible to use that here?
Really appreciate any help or advice with this!