Last active
November 7, 2017 06:51
-
-
Save davebrny/ce25602584c77a50959334ce8ec2e989 to your computer and use it in GitHub Desktop.
(autohotkey) - prepare hotkey text for the send command: ^!a to ^!{a}
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
send_hotkey(string){ | |
modifiers := regExReplace(string, "[^\W]") | |
stringReplace, key, string, % modifiers, , | |
return modifiers "{" key "}" | |
} | |
/* | |
[send hotkey] | |
description = prepare hotkey text for the send command: ^!a to ^!{a} | |
source = https://gist.github.com/davebrny/ce25602584c77a50959334ce8ec2e989 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
autohotkey's send command will send the text
^a
asctrl + a
but will send something like^printscreen
asctrl + p
and then send "rintscreen" as text after it.this command would convert
^printscreen
to^{printscreen}
(wrapping the main key in braces) so it can be used with the send command to sendctrl + printscreen