13
votes

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

3
Try Capslock::Send {ESC}KingRider

3 Answers

22
votes

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
0
votes

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

0
votes

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

$Capslock::Esc
$Esc::Capslock