Created
April 10, 2012 00:26
-
-
Save nimdahk/2347586 to your computer and use it in GitHub Desktop.
HotkeySet() in AutoHotkey for use by AU3 to AHK_L converters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HotkeySet(Hotkey, FunctionName=""){ | |
Global HotkeySet := Object() | |
if !FunctionName | |
{ | |
Try Hotkey, %Hotkey%, Off | |
return 1 ; Not specified in docs, and hell if I'm installing AU3 | |
} | |
Try Hotkey, %Hotkey%, HotkeySet, On | |
catch | |
return 0 ; failure | |
if !IsFunc(functionName) | |
return 0 | |
HotkeySet[Hotkey] := FunctionName | |
return 1 | |
HotkeySet: | |
f := HotkeySet[A_ThisHotkey] | |
%f%() | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment