Created
July 7, 2018 05:26
-
-
Save mitcdh/33aaf96ce2636d0c9e8ed9473059fa93 to your computer and use it in GitHub Desktop.
Hyper Key for Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also see this for disabling the hyper key launching office: https://superuser.com/questions/1455857/how-to-disable-office-key-keyboard-shortcut-opening-office-app