Skip to content

Instantly share code, notes, and snippets.

@thefloodshark
Created April 2, 2018 10:39
Show Gist options
  • Save thefloodshark/213ca2b48403196968e4a2542dceac51 to your computer and use it in GitHub Desktop.
Save thefloodshark/213ca2b48403196968e4a2542dceac51 to your computer and use it in GitHub Desktop.
Toggle Double-Click to Copy
Suspend, on
; Example #4: Detects when a key has been double-pressed (similar to double-click).
; KeyWait is used to stop the keyboard's auto-repeat feature from creating an unwanted
; double-press when you hold down the RControl key to modify another key. It does this by
; keeping the hotkey's thread running, which blocks the auto-repeats by relying upon
; #MaxThreadsPerHotkey being at its default setting of 1.
; Note: There is a more elaborate script to distinguish between single, double, and
; triple-presses at the bottom of the SetTimer page.
~LButton::
if (A_PriorHotkey <> "~LButton" or A_TimeSincePriorHotkey > 400)
{
; Too much time between presses, so this isn't a MsgBox You typed "btw"-press.
KeyWait, LButton
return
}
Send, ^c
return
~$Insert::Suspend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment