1
votes

Remapping Capslock to Esc like so works:

Capslock::Esc

But when I add the following remappings (Esc, Alt-Esc, Ctrl-Esc):

Esc::
!Esc::
^Esc::
return

... for disabling the original Esc key, the Capslock remapping no longer works.

How can I remap Capslock to Esc and disable the original Esc key completely?

I hope you can help me, please.

2
I dont have the answer to your question. But if you disable Esc and then remap Capslock to Esc then you are remaping Capslock to disabled key. Thants why Capslock does not works, because it is maped to disabled key.vasili111

2 Answers

4
votes

As @vasili told, your Capslock goes to Esc, which is disabled.

From example in documentaition, I have found that, if you want to switch two keys you should write something like this:

a::b
b::a

So using this logic I tried to put some usually not used key:

Capslock::Esc

Esc::F15
^!Esc::F15
!Esc::F15
^Esc::F15

F1 through F24 - The 12 or more function keys at the top of most keyboards.

1
votes

Here's an easier one using wildcard (*) and without mapping to unused key:

Capslock::Esc ; Remap Capslock to Esc
*Esc::return  ; Disable Esc pressed with zero or any combination of modifiers

If it doesn't work, add a $ to block the trigger loop:

Capslock::Esc ; Remap Capslock to Esc
$*Esc::return ; Disable Esc pressed with zero or any combination of modifiers

To disable just certain combinations of Esc:

Capslock::Esc
$Esc::
$!Esc::
$^Esc::
return