Skip to content

Instantly share code, notes, and snippets.

@bling
Last active November 17, 2018 15:39
Show Gist options
  • Save bling/8173220 to your computer and use it in GitHub Desktop.
Save bling/8173220 to your computer and use it in GitHub Desktop.
autohotkey bindings
; GistID: 8173220
SendMode Input
#NoEnv
#SingleInstance force
_combined := true
_shiftDown := false
*a::
*b::
*c::
*d::
*e::
*f::
*g::
*h::
*i::
*j::
*k::
*l::
*m::
*n::
*o::
*p::
*q::
*r::
*s::
*t::
*u::
*v::
*w::
*x::
*y::
*z::
*0::
*1::
*2::
*3::
*4::
*5::
*6::
*7::
*8::
*9::
*.::
*,::
*'::
*/::
*\::
*[::
*]::
*-::
*=::
key := SubStr(A_ThisHotkey, StrLen(A_ThisHotkey))
if (_shiftDown) {
_combined := true
SendInput {Blind}+{%key%}
} else {
SendInput {Blind}{%key%}
}
return
;; converts lower-right to arrow-cluster with dual purpose shift/up
RAlt::Left
AppsKey::Down
RCtrl::Right
*RShift::GoSub, UpDown
*RShift Up::GoSub, UpUp
;; needed for UpUp to detect
*LWin::SendInput {LWin down}
*LWin Up::SendInput {LWin up}
;; swaps esc with backtick
Esc::`
+Esc::~
*`::GoSub, EscOrTilde
UpDown:
if (_shiftDown) {
;; already down, so we need to repeat the key instead
SendInput {Blind}{Up}
} else {
_combined := false
_shiftDown := true
}
return
UpUp:
_shiftDown := false
if (not _combined) {
SendInput {Blind}{Up}
}
return
EscOrTilde:
if (_shiftDown or GetKeyState("LShift", "P")) {
_combined := true
SendInput ~
} else {
SendInput {Blind}{Esc}
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment