Skip to content

Instantly share code, notes, and snippets.

@rkennesson
Forked from adinauer/shortcuts.ahk
Last active August 29, 2015 14:14
Show Gist options
  • Save rkennesson/71062864857d02145274 to your computer and use it in GitHub Desktop.
Save rkennesson/71062864857d02145274 to your computer and use it in GitHub Desktop.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetCapsLockState, AlwaysOff
fallback_prevention := 0
caps := 0
;global toggle for caps-modifier (= Capslock key)
*Capslock::caps := 1
*Capslock Up::caps := 0
;=========================
; fallback prevention mode disables navigation keys that are far away from the home row
;=========================
#if fallback_prevention = 1
Left::
Right::
Up::
Down::
PgUp::
PgDn::
Home::
End::
Del::
MsgBox, Use Caps+hjkl for navigation!
return
;=========================
; caps modifier enables different keybindings
;=========================
#if caps = 1
; fallback prevention mode
$*F1::fallback_prevention := !fallback_prevention
; toggle Capslock
$*F2::
if GetKeyState("Capslock", "T") = 0
SetCapsLockState, On
else
SetCapsLockState, AlwaysOff
return
; media control
$*F5::Send, {Blind}{Media_Stop}
$*F6::Send, {Blind}{Media_Play_Pause}
$*F7::Send, {Blind}{Media_Prev}
$*F8::Send, {Blind}{Media_Next}
; volume control
$*F10::Send, {Blind}{Volume_Mute}
$*F11::Send, {Blind}{Volume_Down}
$*F12::Send, {Blind}{Volume_Up}
$*s::Send, {Blind}{Insert}
$*d::Send, {Blind}{Del}
$*e::Send, {Blind}{Esc}
$*i::Send, {Blind}{Home}
$*o::Send, {Blind}{End}
$*m::Send, {Blind}{AppsKey}
$*,::Send, {Blind}{PgDn}
$*.::Send, {Blind}{PgUp}
$*p::Send, {Blind}{PrintScreen}
$*Space::Ctrl
$*RAlt::Shift
; undo / redo
$*u::Send, ^{z}
$*r::Send, ^{y}
; show expose (requires switcher)
$*Tab::Send, #{Tab}
; resize windows (requires winsplit revolution)
$*1::Send, ^!{NumPad1}
$*2::Send, ^!{NumPad2}
$*3::Send, ^!{NumPad3}
$*4::Send, ^!{NumPad4}
$*5::Send, ^!{NumPad5}
$*6::Send, ^!{NumPad6}
$*7::Send, ^!{NumPad7}
$*8::Send, ^!{NumPad8}
$*9::Send, ^!{NumPad9}
; vi hjkl navigation
$*h::Send, {Blind}{Left}
$*j::Send, {Blind}{Down}
$*k::Send, {Blind}{Up}
$*l::Send, {Blind}{Right}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment