TransWikia.com

GroupLatch doesn't work with Shift for some keys using xkb

Unix & Linux Asked by R. Matveev on February 1, 2021

I am using custom keyboard layout with two groups for German and for Cyrillic. CAPS is used as a group latch in two ways. Either one "CAPS followed by the key" or "CAPS+Key" gives keysym for the key in the group other then the current one.

Everything works perfectly well, except for four keys:
"<"=94, "x"=53, "s"=39 and "w"=25. Pressing CAPS+SHIFT+OneOfTheseKeys produces no keysym’s. CAPS followed by SHIFT+Key works as intended with all keys.

I wonder whether this is hardware related (these are neighboring keys on my keyboard) or there is some intricacy I am not seeing?

Here are the relevant pieces from xkb_keymap
including symbols for "s" (latching with shift doesn’t work) and for "d"=40 (latching works):

xkb_keymap {
    //...
xkb_types "complete(slava)" {
    type "FOUR_LEVEL" {
        modifiers= Shift+LevelThree;
        map[Shift]= Level2;
        map[LevelThree]= Level3;
        map[Shift+LevelThree]= Level4;
        level_name[Level1]= "Base";
        level_name[Level2]= "Shift";
        level_name[Level3]= "Level3";
        level_name[Level4]= "Shift Level3";
    };
    // two levels: 1=base and 2=AnyOf(Control,Alt,LevelThree,Mod4).
    // I use it for caps without mod to latch group,
    // with any mod to switch groups
    type "CUSTOM_FOR_CAPS" {
        modifiers= Control+Alt+LevelThree+Mod4;
        map[Control]= Level2;
        map[Alt]= Level2;
        map[LevelThree]= Level2;
        map[Mod4]= Level2;
        level_name[Level1]= "Base";
        level_name[Level2]= "Control Alt LevelThree Mod4";
    };
    //...
};

xkb_compatibility "capslock(grouplatch)" {
    //...
    interpret Caps_Lock+AnyOfOrNone(all) {
        action= LatchGroup(group=+1);
    };
    indicator "Caps Lock" {
        !allowExplicit;
        groups= Group2;
    };
    //...
}

xkb_symbols "pc+de(de-slava)+de(ru-slava):2+capslock(grouplatch)" {
    name[group1]="German (slava)";
    name[group2]="Russian (Germany, phonetic-slava)";

    key <CAPS> { 
        type= "CUSTOM_FOR_CAPS",
        symbols[Group1]= [ Caps_Lock, ISO_Next_Group ],
        symbols[Group2]= [ Caps_Lock, ISO_Prev_Group ]
    };
    key <AC02> {
        type[group1]= "FOUR_LEVEL",
        type[group2]= "FOUR_LEVEL",
        symbols[Group1]= [           s,           S, dollar, dollar ],
        symbols[Group2]= [ Cyrillic_es, Cyrillic_ES, dollar, dollar ]
    };
    key <AC03> {
        type[group1]= "FOUR_LEVEL",
        type[group2]= "FOUR_LEVEL",
        symbols[Group1]= [           d,           D,    eth,    ETH ],
        symbols[Group2]= [ Cyrillic_de, Cyrillic_DE,    eth,    ETH ]
    };
    //...
};
};

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP