Skip to content

Instantly share code, notes, and snippets.

@mitcdh
Created July 7, 2018 05:26
Show Gist options
  • Save mitcdh/33aaf96ce2636d0c9e8ed9473059fa93 to your computer and use it in GitHub Desktop.
Save mitcdh/33aaf96ce2636d0c9e8ed9473059fa93 to your computer and use it in GitHub Desktop.
Hyper Key for Windows
;; based on @babygau's answer here https://stackoverflow.com/a/40559502
#NoEnv ; recommended for performance and compatibility with future autohotkey releases.
#UseHook
#InstallKeybdHook
#SingleInstance force
SendMode Input
;; deactivate capslock completely
SetCapslockState, AlwaysOff
;; remap capslock to hyper
;; if capslock is toggled, remap it to esc
;; note: must use tidle prefix to fire hotkey once it is pressed
;; not until the hotkey is released
~Capslock::
;; downtemp tells subsequent sends that the key is not permanently down, and may be released whenever a keystroke calls for it.
Send {Ctrl DownTemp}{Shift DownTemp}{Alt DownTemp}{LWin DownTemp}
KeyWait, Capslock
Send {Ctrl Up}{Shift Up}{Alt Up}{LWin Up}
if (A_PriorKey = "Capslock") {
Send {Esc}
}
return
;; vim navigation with hyper and additional modifiers
~Capslock & h:: Send {Blind}{Left}
~Capslock & l:: Send {Blind}{Right}
~Capslock & k:: Send {Blind}{Up}
~Capslock & j:: Send {Blind}{Down}
;; Hyper+c/v to copy/paste
~Capslock & c:: Send ^{c}
;;~Capslock & v:: Send ^{v} ;map to ditto instead
;; Hyper+a to set window to always on top
~Capslock & a:: Winset, Alwaysontop, , A
@amirdt22
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment