Edit

kc3-lang/libxkbcommon/changes/api/+empty-key-handling.bugfix.md

Branch :

  • Show log

    Commit

  • Author : Pierre Le Marre
    Date : 2025-04-02 10:46:06
    Hash : e09cbe66
    Message : symbols: Fix handling of empty keys Before this commit, the following symbols: ```c xkb_symbols { virtual_modifiers M1, M2; key <A> {}; key <B> { [] }; key.vmods = M1; key <C> {}; key <D> { vmods = M2 }; }; ``` would be equivalent to: ```c xkb_symbols { virtual_modifiers M1,M2; key <B> { [ NoSymbol ] }; }; ``` `<B>` entry could be skipped but is harmless. However, `<C>` and `<D>` are missing, which would lead to the mapping resolution of `M1` and `M2` failing. After this commit, it is equivalent to: ```c virtual_modifiers M1,M2; key <C> { vmods = M1 }; key <D> { vmods = M2 }; ``` Empty keys are skipped entirely, but any explicit field: - is taken into account: previously they would be skipped if there were no group; - forces the key to be printed at serialization.

  • changes/api/+empty-key-handling.bugfix.md
  • Fixed the handling of empty keys. Previously keys with no symbols nor actions
    would simply be skipped entirely. E.g. in the following:
    
    ```c
    key <A> { vmods = M };
    modifier_map Shift { <A> };
    ```
    
    the key `<A>` would be skipped and the virtual modifier `M` would not be
    mapped to `Shift`. This is now handled properly.