OneDeadKey / kalamine

Keyboard Layout Maker
MIT License
105 stars 29 forks source link

[xkb] AltGr = Level3_Shift, 1dk = Level5_Latch #60

Closed fabi1cazenave closed 8 months ago

fabi1cazenave commented 8 months ago

Until now, kalamine used to generate XKB layouts where the AltGr key was an ISO_Level5_Shift, and the 1dk was an ISO_Level3_Latch. This is unnatural and possibly confusing, e.g. :

The reason for this was that I had never been able to make an ISO_Level5_Latch work… until now. And it’s so simple that I really can’t figure out how I could’ve missed that.

Anyway. Here’s a quick patch to test it. Let’s find out if it breaks on older systems.

fabi1cazenave commented 8 months ago

Note that the *.xkb output is not affected — it still relies on the old two-group strategy.

This patch affects xkalamine install and the *.xkb_custom output, which rely on an 8-level strategy.

fabi1cazenave commented 8 months ago

FTR, it turned out activating this ISO_Level5_Latch wasn’t as easy as expected, as this symbol seems to be ignored unless xkb/symbols/level5 is somehow included :

So it seems the most robust solution is to copy the relevant part of include "level5(modifier_mapping)" into our XKB patches :

replace key <MDSW> {
    type[Group1] = "ONE_LEVEL",
    symbols[Group1] = [ ISO_Level5_Shift ]
};
modifier_map Mod3 { <MDSW> };

The <MDSW> key (Mode_switch) has always been there ; nowadays it’s just an alias for the more self-explanatory <LVL5> key — and we should be confident this alias is here to last.

Kudos to @nivopol for his help on this !

fabi1cazenave commented 8 months ago

Mentioning #55, as this <MDSW> solution is related to the support of dead keys in the 1dk layer.

fabi1cazenave commented 8 months ago

FTR,  in xkb/symbols/pc :

… and not the other way around, as one could expect.