Skip to content

Instantly share code, notes, and snippets.

@davebrny
Last active September 21, 2020 11:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davebrny/383ab4158e4220f5658223475ad57719 to your computer and use it in GitHub Desktop.
Save davebrny/383ab4158e4220f5658223475ad57719 to your computer and use it in GitHub Desktop.
(autohotkey) - double tap function to send a hotkey or label
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
*/
@lingchuanbo
Copy link

How use?

@davebrny
Copy link
Author

davebrny commented Nov 1, 2019

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