Last active
September 21, 2020 11:00
-
-
Save davebrny/383ab4158e4220f5658223475ad57719 to your computer and use it in GitHub Desktop.
(autohotkey) - double tap function to send a hotkey or label
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
double_tap(single_tap, double_tap, tap_time="T.2") { | |
key := LTrim(a_thisHotkey, "~$*") | |
key := regExReplace(key, "[\Q^!+#\E]") ; remove modifiers | |
keyWait, % key | |
keyWait, % key, D %tap_time% | |
if (errorLevel) | |
sub_send(single_tap) | |
else sub_send(double_tap) | |
} | |
sub_send(action) { | |
if isLabel(action) | |
goSub, % action | |
else send, % action | |
} | |
/* | |
[script info] | |
description = double tap function to send a hotkey or label | |
author = davebrny | |
source = https://gist.github.com/davebrny/383ab4158e4220f5658223475ad57719 | |
*/ |
How use?
a::double_tap("a", "A")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How use?