Edit

kc3-lang/libxkbcommon/test/data/symbols/latch

Branch :

  • Show log

    Commit

  • Author : Pierre Le Marre
    Date : 2025-05-06 14:35:26
    Hash : 230b6a6a
    Message : Fix key type map entry with unbound vmod not ignored Currently we only ignore key type map entries with non-zero mods and with a zero modifier mask. However, the XKB protocol states ([source]): > Map entries which specify unbound virtual modifiers are not considered. So we currently handle `map[Unbound]` key type map entries (all modifiers unbound) but not `map[Bound+Unbound]` entries (mix of bound and unbound modifiers). Fixed by properly checking unbound modifiers on each key type map entry. This also fixes a test that was accidentally passing. [source]: https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html#:~:text=Map%20entries%20which%20specify%20unbound%20virtual%20modifiers,not%20considered

  • test/data/symbols/latch
  • default partial alphanumeric_keys
    xkb_symbols "modifiers" {
    	name[Group1] = "Test latching behavior";
    
    	virtual_modifiers Alt=Mod1, LevelThree;
    
    	key <AE01> { [ 1, exclam, onesuperior, exclamdown, plus ], type[Group1]="CTRL+ALT"};
    
    	key <AD01> { [ q, Q ], type[Group1] = "ALPHABETIC" };
    
    	key <LFSH> {
    		symbols[Group1] = [ Shift_L ],
    		actions[Group1] = [ LatchMods(modifiers=Shift,latchToLock=true,clearLocks=true) ]
    	};
    
    	key <RTSH> {
    		symbols[Group1] = [ Shift_R ],
    		actions[Group1] = [ LatchMods(modifiers=Shift,latchToLock=false,clearLocks=false) ]
    	};
    
    	key <LCTL> {
    		symbols[Group1] = [ Control_L ],
    		actions[Group1] = [ LatchMods(modifiers=Control) ]
    	};
    
    	key <LALT> {
    		type[Group1] = "ONE_LEVEL",
    		symbols[Group1] = [ Alt_L ],
    		actions[Group1] = [ LatchMods(modifiers=Alt) ]
    	};
    
    	key <RALT> {
    		type[Group1] = "ONE_LEVEL",
    		symbols[Group1] = [ ISO_Level3_Latch ],
    		actions[Group1] = [ LatchMods(modifiers=LevelThree,latchToLock=true,clearLocks=true) ]
    	};
    
    	key <MENU> {
    		type[Group1] = "ONE_LEVEL",
    		symbols[Group1] = [ ISO_Level3_Latch ],
    		actions[Group1] = [ LatchMods(modifiers=LevelThree,latchToLock=false,clearLocks=false) ]
    	};
    
    	key <FK01> { [XF86_Switch_VT_1], type[Group1] = "ONE_LEVEL" };
    	key <FK02> { [ISO_Group_Shift], type[Group1] = "ONE_LEVEL" };
    
    	key <LSGT> { [ ISO_Level3_Lock ], type[Group1] = "ONE_LEVEL" };
    
    	key <CAPS> { [ ISO_Group_Latch ] };
    };