1

Why can't I switch my layout with these settings:

setxkbmap -layout us,ru -option grp:alt_caps_toggle,compose:caps

Is it possible at all to have a compose key assigned on CapsLock and a layout switch combination relied on this key?

Also, how to turn off Shift+CapsLock combination?

1 Answers1

1

Let’s have a look at how these things are defined in xkeyboard-config.

alt_caps_toggle:

// Pressing Alt+Caps_Lock switches to the next group,
// pressing Caps_Lock toggles CapsLock.
partial modifier_keys
xkb_symbols "alt_caps_toggle" {
    key <CAPS> {
       type="PC_ALT_LEVEL2",
       symbols[Group1] = [ Caps_Lock, ISO_Next_Group ]
    };
};

alt_caps_toggle maps the caps lock key to Caps_Lock (level 1) and ISO_Next_Group (level two, accessed by pressing Alt (type="PC_ALT_LEVEL2")).

caps:

partial modifier_keys
xkb_symbols "caps" {
    key <CAPS> { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] };
};

caps maps both levels to Multi_key (compose).

These two definitions are not compatible; they map the caps lock key to different keysyms. One of them will simply override the other.

You might have to implement this functionality yourself. You’ll probably want something like this:

type="PC_ALT_LEVEL2",
symbols[Group1] = [ Multi_key, ISO_Next_Group ]

That is, compose on the first level and group switcher on the second level, with Alt as the level 2 switch.

Guildenstern
  • 420
  • 4
  • 11