39aldo39 / klfc

Keyboard Layout Files Creator
GNU General Public License v3.0
222 stars 12 forks source link

The `NONE_SHIFT_ALTGR_ALPHABETIC` keys are partially ignored by `xkbcomp`. #26

Closed kindaro closed 4 years ago

kindaro commented 4 years ago

Description:

I am trying to build a customized fr(bepo) layout. You can see my source and build script here. Unfortunately, I discover that I cannot type ~, the tilde sign. I looked at the compiled key map files and I discovered that keys that have type NONE_SHIFT_ALTGR_ALPHABETIC lose their type when translated by xkbcomp, along with some of the mappings. See the relevant files:

  1. After converting json to xkb with klfc, the file xkb/symbols/kindaro-bepo:

        ...
        key.type[Group1] = "FOUR_LEVEL";
        key <AB04> { [       period,        colon,     ellipsis, periodcentered ] };
        key.type[Group1] = "NONE_SHIFT_ALTGR_ALPHABETIC";
        key <AB05> { [            k,            K,   asciitilde ] };
        key.type[Group1] = "FOUR_LEVEL";
        key <AB06> { [   apostrophe,     question, questiondown,    dead_hook ] };
        ...
  2. After invoking xkbcomp, the file xkm/kindaro-bepo.xkb:

        ...
        key <AB04> {
            type= "FOUR_LEVEL",
            symbols[Group1]= [          period,           colon,        ellipsis,  periodcentered ]
        };
        key <AB05> {         [               k,               K ] };
        key <AB06> {
            type= "FOUR_LEVEL",
            symbols[Group1]= [      apostrophe,        question,    questiondown,       dead_hook ]
        ...

An inspection reveals that all other keys of this type also lose the type.

Try it yourself:

The commit I linked above contains a build script. Clone, run, and you will have obtained these same files.

My proposal:

It seems that xkbcomp does not recognize the type we want it to recognize. We can use FOUR_LEVEL type instead and pad with NoSymbol.

kindaro commented 4 years ago

It is actually my fault. I did not make sure that setxkbmap is made aware of the types file generated by klfc. If I add something like -types complete+kindaro-bepo, the types will be included and every key will be accounted for.

39aldo39 commented 4 years ago

Note that I also created the script run-session.sh to set the layout, which you might find useful. It should be there with the generated files.