Disable Capslock, Windows Key

By Xah Lee. Date: . Last updated: .

For a easy solution without code, use Microsoft PowerToys

Disable CapsLock

AutoHotkey code to disable CapsLock:

SetCapsLockState, off
$CapsLock::Return

Make Caps Lock Key Do Control

; make Caps Lock key do Control
CapsLock::Ctrl

[see AutoHotkey Key Syntax]

; make the capslock key behave as menu/AppsKey
CapsLock::AppsKey

The ▤ Menu key is actually very useful. See: Keyboard Menu/App Key .

Disable Number Lock

SetNumLockState, on
$NumLock::Return

Disable Scroll Lock

SetScrollLockState, off
$ScrollLock::Return

Disable Windows Logo Key

Disable Win Key Completely

;; disable the Win key completely
Lwin::return
Rwin::return

Disable Win Key Start Menu Behavior

;; disable Win key behavior of popping up the Start Menu, but don't disable Win+key combination
~LWin Up::Return
~RWin Up::Return

Disable Win+key Combination

;; disable some Win+key combination
#1::Return
#r::Return
#e::Return

Note: the ❖ Window+l (lock computer) cannot be disabled.

Disable F1 Help

#F1::Return

Instead of disable keys, it's better to set them to do something useful, such as switching app/window/tab, or copy cut paste.

AutoHotkey Tutorial

AutoHotkey logo nz9fX