Skip to content

Instantly share code, notes, and snippets.

@laurelkeys
Created August 29, 2020 18:07
Show Gist options
  • Save laurelkeys/0008bd131e4a1680f58466cac73901c1 to your computer and use it in GitHub Desktop.
Save laurelkeys/0008bd131e4a1680f58466cac73901c1 to your computer and use it in GitHub Desktop.
AutoHotKey script to map CapsLock + { i, j, k, l } to Arrow Keys
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Disable CapsLock
SetCapsLockState, AlwaysOff
/* Base layer
* ,----------------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
* |----------------------------------------------------------------------------------------+
* | | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
* |----------------------------------------------------------------------------------------+
* | Shift | Z | X | C | V | B | N | M | , | . | / | Shift |
* `----------------------------------------------------------------------------------------'
*/
/* Caps Lock layer
* ,----------------------------------------------------------------------------------------.
* | | | | | | | PgUp| Home| Up | End | PgDn| | | |
* |----------------------------------------------------------------------------------------+
* | | | | | | | Ins | Left| Down|Right| Del | | |
* |----------------------------------------------------------------------------------------+
* | | | | | | | | | | | | |
* `----------------------------------------------------------------------------------------'
*/
; CapsLock + { i, j, k, l } = { Up, Left, Down, Right }
CapsLock & j::Left
CapsLock & l::Right
CapsLock & i::Up
CapsLock & k::Down
; CapsLock + { u, o } = { Home, End }
CapsLock & u::Home
CapsLock & o::End
; CapsLock + { h, ; } = { Ins, Del }
CapsLock & h::Ins
CapsLock & `;::Del
; CapsLock + { y, p } = { PgUp, PgDn }
CapsLock & y::PgUp
CapsLock & p::PgDn
Return
@bishnukhadka
Copy link

bishnukhadka commented Mar 10, 2023

"SetCapsLockState, AlwaysOff" doesn't let caps lock to be on, so we cannot turn on CAPSLOCK. And if we delete this line, while doing CAPSLOCK+ IJKL with a relatively high speed, it types the letter a fair few time. Is there a solution for this?

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