Skip to content

Instantly share code, notes, and snippets.

@ulic-youthlic
ulic-youthlic / capslock.ahk
Last active October 22, 2024 02:01
map my <CapsLock> to <Esc>(alone) and <C-x>(with other key) using AutoHotKey v2.0.
#Requires AutoHotkey v2
; Install the keyboard hook to capture the real key state of the keyboard
InstallKeybdHook(true)
; Disable the CapsLock key
SetCapsLockState("alwaysoff")
; Send esc key when Capslock is pressed as default
g_DoNotAbortSendEsc := true
$*Capslock::{ ; Capture CapsLock key press
global g_DoNotAbortSendEsc ; use global variable g_DoNotAbortSendEsc
@ulic-youthlic
ulic-youthlic / kanata.kbd
Created July 23, 2024 14:05
Kanata configuration for mapping `Capslock`.
#|
Kanata
CapsLock tap to Esc
CapsLock hold to Ctrl
|#
(defcfg
process-unmapped-keys no
)