You are not logged in.

#1 2026-01-02 18:02:28

Apollo13
Member
Registered: 2026-01-02
Posts: 2

override cmd key to be used as esc

hello,

i just recently installed arch on a 2013 macbook air i had lying around and dont really have any linux experience other than that. i found that the cmd key isnt really being used so i wanted to override it to turn it into the esc key for nvim. ive been playing around with it but have only really managed to brick my laptop a couple times by making every key something completely random (i figured out i could boot iso and undo the changes i had made to fix this). if anybody knows how to do this please point me in the right direction.

- apollo

(i realise this is not entirely specific to arch and i am only posting here because i happen to be using it so if anybody knows a forum that would be better suited let me know)

edit:
i realised this might be important: i did figure out how to do this by putting "keycode 125 = Escape" into a file in "/usr/share/kbd/keymaps/mac/all/" and then executing "sudo loadkeys /usr/share/..." but i would have to do that every time i boot so im looking for a more permanent option

Last edited by Apollo13 (2026-01-02 18:07:02)

Offline

#2 2026-01-02 20:49:34

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,269

Re: override cmd key to be used as esc

https://wiki.archlinux.org/title/Linux_ … figuration but /usr/share/kbd/keymaps  will only affect the console - do you plan to run a display server (X11 or wayland)?
If your display server cannot map the key, see https://wiki.archlinux.org/title/Input_remap_utilities - though I'd expect this to work OOTB (could not find anything in the wiki discussing problems w/ that key, though it's indeed mapped to Void on the console by default)

Online

#3 2026-01-02 22:46:35

Apollo13
Member
Registered: 2026-01-02
Posts: 2

Re: override cmd key to be used as esc

thanks! i intend to just run it in tty so i think that should work

Offline

Board footer

Powered by FluxBB