Skip to content

Instantly share code, notes, and snippets.

@kudorgyozo
Last active September 30, 2023 14:19
Show Gist options
  • Save kudorgyozo/b15c5420f53b024aa5206ebc7b0cf120 to your computer and use it in GitHub Desktop.
Save kudorgyozo/b15c5420f53b024aa5206ebc7b0cf120 to your computer and use it in GitHub Desktop.
autohotkey repeat key, also beep on enable disable
#Requires AutoHotkey v2.0
#SuspendExempt
^`::
{
if (A_IsSuspended) {
SoundBeep 392, 300
} else {
SoundBeep 261, 300
}
Suspend ; Ctrl+Alt+S
}
#SuspendExempt False
; ~ : passes the keydown through
; $ : allows sending hotkey itself
~$e::
{
Sleep(400) ;Repeat delay
While GetKeyState("e", "P")
{
SendInput "{e Down}" ;repeated keydowns
Sleep(50) ;Repeat rate
SendInput "{e up}" ;repeated keydowns
Sleep(50) ;Repeat rate
;SendInput "{e Up}"
;Sleep(100)
} ; ~ passes the keyup through
Return
}
; ~LButton:: ; ~ passes the keydown through
; {
; Sleep(400) ;Repeat delay
; While GetKeyState("LButton", "P")
; {
; SendInput "{LButton Down}" ;repeated keydowns
; Sleep(100) ;Repeat rate
; } ; ~ passes the keyup through
; Return
; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment