option `grp:shifts_toggle` fails when used with German E1 layout
To see what I mean, run:
setxkbmap us,de basic,e1 -option -option grp:shifts_toggle
Now press both Shift keys to toggle to the second layout (E1). Check that you're indeed in E1 by pressing for example what is the semicolon key in the US layout. It produces ö
. Now press both Shift keys again, and try the semicolon key again: ö
. When the German E1 layout is one of your groups, the Shifts toggle does not work.
The problem is threefold. First: the E1 layout specifies not just the normal character keys but also the two Shift keys, LFSH
and RTSH
, and it specifies those two keys with an explicit type of ONE_LEVEL. Second: the option shifts_toggle
does not specify any type when assigning new symbols to the Shift keys, meaning that the type of ONE_LEVEL does not get changed, so the second-level symbols are lost. Third: the option shifts_toggle
gets applied only to the first group, so even if this option would specify a new type for the Shift keys, it would not affect the E1 layout when the latter is not the first group.
The easiest solution would be to remove the definitions of the Shift keys from the E1 layout. I guess that they are there only so as to normalize the Shift keys when the layout is used together with the T3 layout. But T3 is obsolete, and is a mad layout -- people that use it should be prepared for problems. What do you think, @gandaro?
The more general solution would be to do for shifts_toggle
what was done for ctrl_space_toggle
in commit 119e922f (and later to a few others too): give it five per-group rules instead of one general rule.