1

My keyboard setup is this command:

exec setxkbmap -layout us,us -variant altgr-intl,colemak -option caps:escape,grp:alt_shift_toggle

It maps caps lock to escape for qwerty, but in Colemak, there is a backspace key where caps lock used to be (which is why my question is not exactly the same as this one). I want to remap Colemak's left-backspace to escape, but keep my right-backspace key the same. Is there a way to do that, preferably with an easy command, like the command above?

Jonathan
  • 1,270

1 Answers1

0

You can see in /usr/share/X11/xkb/symbols/us that the key is still called <CAPS> even though it produces BackSpace symbols.

Look at setxkbmap -print -- see the us(colemak):2 in the xkb_symbols line?

$ setxkbmap -print
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us(altgr-intl)+us(colemak):2+inet(evdev)+group(alt_shift_toggle)+capslock(escape)" };
    xkb_geometry  { include "pc(pc105)" };
};

I think a +capslock(escape):2 added to that line should work, but doesn't seem to, and I'm not familiar enough with multiple-group layouts to know whether this is a general problem with XKB options or a syntax I'm missing.


You may need to provide a modified colemak definition:

// colemak layout with escape on capslock instead of backspace
partial alphanumeric_keys
xkb_symbols "colemak-esc" {
    // start with existing colemak layout
    include "us(colemak)"

    key <CAPS> { [ Escape, Escape, Escape, Escape ] }
};

You can add that to /usr/share/X11/xkb/symbols/us, or your own file in $HOME/.xkb/symbols, and load it with setxkbmap. See some additional references for where and how to load:

quixotic
  • 1,140