autohotkey

Remap Capslock to Esc and disable original Esc key in AutoHotkey


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.


Solution

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

    From example in the Remap documentation, 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.