21

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

Anonsage
  • 8,030
  • 5
  • 48
  • 51

3 Answers3

33

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
Anonsage
  • 8,030
  • 5
  • 48
  • 51
  • 2
    For completeness, since escape key is mapped to caps lock, I enable the escape to be the caps lock key. `Esc::Capslock` – Nasri Najib Mar 16 '21 at 02:05
8

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

$Capslock::Esc
$Esc::Capslock
Al-Baraa El-Hag
  • 770
  • 6
  • 15
0

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

KingRider
  • 2,140
  • 25
  • 23