ISO_Level5_Shift does not work when de(neo) is the second layout
When the German Neo layout is not the first layout, then holding the right Alt key (which produces ISO_Level5_Shift
in that layout) does not result in the relevant modifier (Mod3) being set, so that holding the key has no effect, making the layout less useful. To see it happening, do:
setxkbmap us,de ,neo -option -option grp:ctrls_toggle
xev | grep " state"
Then press both Ctrl keys to switch to the Neo layout; see that the state changes to 0x2000, meaning that the second group is active. Now press the digit 1 key (<AE01>
); see that it produces keysym 0x31, as it should. Now press and hold the right Alt key; see that keysym 0xfe11 (ISO_Level5_Shift
) is produced, but there is no state change. Now pressing <AE01>
still produces keysym 0x31. Release the right Alt key and press Shift+CapsLock+Tab; see that the state changes to 0x2010, meaning that Mod2 is set, which is bound to virtual modifier NumLock, which the Neo layout uses to lock the fifth level. Now press <AE01>
again; see that it produces keysym 0xaa (ordfeminine, ª
), as it should. So the fifth level works fine, it's just the level5 chooser (the AltGr key or the Lsgt key) that does not work.
One could remove the useModMapMods=level1
from the interpret
rule for ISO_Level5_Shift
(in compat/level5
), but doing that doesn't make the layout work, because then holding the right Alt key sets both the LevelFive modifier (Mod3) and the Alt modifier (Mod1), meaning that then pressing <AE01
seems to produce ordfeminine (ª
) just fine, but when actually using the layout and typing <AE01>
at a bash prompt it beeps and produces �, and typing the key in nano says "Unknown sequence"; preceding the keystroke with Alt+V shows why: <AE01>
produces ESC followed by ª
, which was to be expected as the Alt modifier is set. So, dropping the useModMapMods=level1
is not the solution.
Doing xkbcomp :0 neo.map
and then changing this fragment:
key <MDSW> {
type= "ONE_LEVEL",
symbols[Group1]= [ Mode_switch ],
symbols[Group2]= [ ISO_Level5_Shift ]
};
to this:
key <MDSW> {
type= "ONE_LEVEL",
symbols[Group1]= [ ISO_Level5_Shift ]
};
and then loading the key map back into server with xkbcomp neo.map :0
makes the right Alt key function perfectly fine as fifth-level chooser.
The association of the Mode_switch
symbol with the Mod5 modifier (through the binding of that symbol to <MDSW>
and the modifier_mapping of this key to Mod5) is pointless: it is not needed to temporarily switch to the next group, it was there only as some service to applications that were not XKB-aware. Hopefully these have all died out (and if not, we should push them). So... I propose to change the default binding of <MDSW>
in symbols/pc
from Mode_switch
to ISO_Level5_Shift
, to make eight-level layouts work in whatever group they are.