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

Make Caps Lock Key Do Control

; make Caps Lock key do Control

[see AutoHotkey Key Syntax]

; make the capslock key behave as menu/AppsKey

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

Disable Number Lock

SetNumLockState, on

Disable Scroll Lock

SetScrollLockState, off

Disable Windows Logo Key

Disable Win Key Completely

;; disable the Win key completely

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

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

Disable F1 Help


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