Anonsage
Anonsage

Reputation: 8320

How to map caps lock to ESC in AutoHotkey?

How to set up AutoHotkey so that when I press the Caps Lock, it will instead send the ESC key to the computer?

Upvotes: 24

Views: 17319

Answers (3)

Al-Baraa El-Hag
Al-Baraa El-Hag

Reputation: 871

If you want to also map Esc to Capslock at the same time, do this:

$Capslock::Esc
$Esc::Capslock

Upvotes: 9

KingRider
KingRider

Reputation: 2257

Use Window Spy or try F12:keyhistory to viewer a key code

https://autohotkey.com/docs/commands/Send.htm

Keymapping:

Capslock::MsgBox,,,test1

VK

vk14::MsgBox,,,test2

SC

sc03A::MsgBox,,,test13

Screenshot:

enter image description here

Look: https://autohotkey.com/docs/commands/Send.htm

Upvotes: 1

Anonsage
Anonsage

Reputation: 8320

Mapping Caps Lock key to ESC key can be done as:

Capslock::Esc

Using this format, you can easily map Caps Lock to any key, for example, the enter key:

Capslock::Enter

Upvotes: 37

Related Questions