Comment 208 for bug 36812

Revision history for this message
In , Adam Purkrt (adam-purkrt-deactivatedaccount) wrote :

Perhaps easier variant of the above workaround pertaining Alt+Shift is to comment out the following (eight) lines in /usr/share/X11/xkb/symbols/group

first change (search for "lalt_lshift"):

partial modifier_keys
xkb_symbols "lalt_lshift_toggle" {
    virtual_modifiers Alt;
    key <LALT> {
        symbols[Group1] = [ NoSymbol, ISO_Next_Group ],
        virtualMods= Alt
    };
// key <LFSH> {
// type[Group1]="PC_ALT_LEVEL2",
// symbols[Group1] = [ Shift_L, ISO_Next_Group ]
// };
};

second change (~15 lines below):

partial modifier_keys
xkb_symbols "ralt_rshift_toggle" {
    virtual_modifiers Alt;
    key <RALT> {
        symbols[Group1] = [ NoSymbol, ISO_Next_Group ],
        virtualMods= Alt
    };
// key <RTSH> {
// type[Group1]="PC_ALT_LEVEL2",
// symbols[Group1] = [ Shift_R, ISO_Next_Group ]
// };
};

then load the keymap, in my case

$ setxkbmap us,cz -option grp:alt_shift_toggle

or set it through gui (Change layout option=Alt+Shift in XFCE), or just restart X server if you've already done so

Now <shift>+<left alt> (*in that order*, i.e. first press and hold any shift, then press left alt) switches keyboard layout

<alt>+<shift> (first alt, then shift) works as a modifier (i.e. shortcuts work), and does nothing in itself

<alt>+<shift>+<tab> works as it should

It would be nice to actually have a separate "rule" for this - titled "Shift+LAlt", available with -grp:shift_lalt_toggle, but unfortunatelly I don't know how to modify the rules files..