Skip to content

Instantly share code, notes, and snippets.

@ni554n
Created April 24, 2026 21:12
Show Gist options
  • Select an option

  • Save ni554n/a9a0a1adebca98371401e7d0d1f5ffd0 to your computer and use it in GitHub Desktop.

Select an option

Save ni554n/a9a0a1adebca98371401e7d0d1f5ffd0 to your computer and use it in GitHub Desktop.
#Requires AutoHotkey v2.0 ; https://www.autohotkey.com/docs/v2/
; # Win
; ! Alt
; ^ Ctrl
; + Shift
; * Any modifier
; < > Left or Right mod variant prefix
CapsLock::Escape
Insert::CapsLock
; https://www.autohotkey.com/docs/v2/lib/Send.htm
SendWithMods(key) {
mods := ""
if GetKeyState("Control", "P")
mods .= "^"
if GetKeyState("Shift", "P")
mods .= "+"
SendInput mods . key
}
*<!h::SendWithMods "{Left}"
*<!j::SendWithMods "{Down}"
*<!k::SendWithMods "{Up}"
*<!l::SendWithMods "{Right}"
*<!i::SendWithMods "{Home}"
*<!o::SendWithMods "{End}"
!;::SendInput "{Backspace}"
<!'::SendEvent "{Ctrl down}{Backspace}{Ctrl up}" ; SendEvent is slower but works reliably in modern Windows forms.
!+;::SendEvent "{Delete}"
<!+'::SendEvent "{Ctrl down}{Delete}{Ctrl up}"
<!,::SendInput "^+{Tab}"
<!.::SendInput "^{Tab}"
<+<!,::SendInput "!{Left}"
<+<!.::SendInput "!{Right}"
>!q::SendInput "!{F4}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment