option `grp:ctrls_toggle` does not overrule `lv3:switch`
Commit e66a0ed3 got me thinking: the group-related options in rules/0042-o_s.part
are placed before most of the other options. This means that any of these later options will "prevail" when combined with a group-related option. Do for example:
setxkbmap us,es intl,basic -option -option lv3:switch -option grp:ctrls_toggle
Even though the grp:
option is mentioned after the lv3:
option, the ordering in rules/0042-o_s.part
makes that in the configuration that setxkbmap
presents to xkbcomp
, the +group(ctrls_toggle)
fragment comes before the +level3(switch)
fragment, meaning that the latter prevails and the Ctrl keys are defined like this:
key <LCTL> {
type= "PC_CONTROL_LEVEL2",
symbols[Group1]= [ Control_L, ISO_Prev_Group ]
};
key <RCTL> {
type= "ONE_LEVEL",
symbols[Group1]= [ ISO_Level3_Shift ]
}
This means that one cannot toggle between groups by pressing the two Ctrl keys together.
If the two fragments were applied in the reverse order, then the right Ctrl key would instead be defined like this:
key <RCTL> {
type= "PC_CONTROL_LEVEL2",
symbols[Group1]= [ ISO_Level3_Shift, ISO_Next_Group ]
};
That means that by itself the right Ctrl key would work as a third-level chooser, but when the left Ctrl key is pressed first and then the right Ctrl key, then the next group will become active. So the two options are combined in a useful way, instead of the level3 option invalidating the group option. And this result was the intention of the grp:ctrls_toggle
, because it explicitly does not define symbols for the first level of the Ctrl keys, leaving it to other options to maybe change those symbols.
In conclusion: all of the grp:
options should come after all of the other options in rules/0042-o_s.part
because when one has multiple groups, one wants the chosen group toggle to simply work, even if this means that another option is overruled or its behavior modified. However, this might affect people that use just one group but nevertheless chose a group-switching option (maybe because the Xfce keyboard dialog prominently shows this choice) alongside other options. Until now, most of these other options came after the group options and were thus not affected by these. But if we change the order... (The solution is, of course, for the user to not choose a group-switching option when they do not need it. But some users might not be aware that they chose such an option, because until now the choice didn't have any effect.)