Enable 'replace' directive for xkbcomp in the definition of symbols in a section
Submitted by Etsushi Kato
Assigned to Xorg Project Team
Description
(This bug is separated from bug #8805 comment 25 in xkeyboard-config)
Optional symbols file(section) inclusion (like +compose(ralt), +ctrl(ctrl_aa), and so on) only overwrites some groups symbols in a certain situation.
This works fine for a single group XKB setting and/or multiple groups setting with all groups uses same symbol which is defined in the same file(section) for the target key.
But these optional setting doesn't work for certain groups when using multiple groups XKB setting with different symbols is mapped to a certain key.
For example, <LCTL>
and <CAPS>
keys in "pc+us+jp:2" are mapped as follows.
key `<LCTL>` { [ Control_L ] };
key `<CAPS>` {
symbols[Group1]= [ Caps_Lock ],
symbols[Group2]= [ Eisu_toggle, Caps_Lock ]
};
And using ctrl(ctrl_ac) option, "pc+us+jp:2+ctrl(ctrl_ac), produces following map.
key `<LCTL>` {
symbols[Group1]= [ Caps_Lock ],
symbols[Group2]= [ Control_L ]
};
key `<CAPS>` {
symbols[Group1]= [ Control_L ],
symbols[Group2]= [ Eisu_toggle, Caps_Lock ]
};
This is unwanted behavior. And I think these optional setting for symbols should use 'replace' merge mode instead of 'override' merge mode. But in a XKB keymap, we cannot use "replace file(section)" notation. Only "+ file(section)" is available, which means 'override' merge mode.
So, I propose to enable 'replace' directive in a section of symbols definition. With the attached patch for xkbcomp and changes to use 'replace' in these option (see below) can solve the problem.
partial modifier_keys
xkb_symbols "ctrl_aa" {
replace key <AA00>
{ [ Control_L ] };
replace key <AC00>
{ [ Caps_Lock ] };
};