Edit

kc3-lang/libxkbcommon/test/data/keymaps/keycodes-bounds-multiple-1.xkb

Branch :

  • Show log

    Commit

  • Author : Pierre Le Marre
    Date : 2025-03-30 10:07:10
    Hash : 8ba5c453
    Message : xkbcomp: Use section reference as default section name Before this commit the following keymap: ```c xkb_keymap { xkb_keycode {}; }; ``` would result in (boilerplate removed): ```c xkb_keymap { xkb_keycode "(unnamed)" {}; }; ``` This is both useless and wasting allocation: section names are optional, so we should just remove this default name altogether and keep it undefined, as in the original keymap. The situation is a bit different if there is an include, as for keymaps created from RMLVO names. Before this commit, the following keymap: ```c xkb_keymap { xkb_keycode { include "evdev+aliases(qwerty)" }; }; ``` would result in (boilerplate removed): ```c xkb_keymap { xkb_keycode "(unnamed)" { … }; }; ``` With this commit we now follow the Xorg xkbcomp style by using the section reference (the include string) as the *default* section name. So the previous example would now result in: ```c xkb_keymap { xkb_keycode "evdev_aliases(qwerty)" { … }; }; ``` which is useful to give a hint of the original include. Note that if the original section had a name, it would preserve it: ```c xkb_keymap { xkb_keycode "test" { include "evdev+aliases(qwerty)" }; }; ``` would compile to: ```c xkb_keymap { xkb_keycode "test" { … }; }; ```

  • test/data/keymaps/keycodes-bounds-multiple-1.xkb
  • xkb_keymap {
    xkb_keycodes {
    	minimum = 1;
    	maximum = 300;
    	<A>                  = 1;
    	<B>                  = 300;
    };
    
    xkb_types {
    	type "default" {
    		modifiers= none;
    	};
    };
    
    xkb_compatibility {
    	interpret.useModMapMods= AnyLevel;
    	interpret.repeat= False;
    };
    
    xkb_symbols {
    };
    
    };