Edit

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

Branch :

  • Browse

    Commit

  • Author : Pierre Le Marre
    Date : 2025-01-24 11:10:17
    Hash : 7a08b145
    Message : tests: Modifier and group latch - Added a big bunch of tests for modifier latch. No yet exhaustive, but should cover the most usual use cases. - Added missing test cases for breaking the group latch. Ideally, more tests should be added to match the coverage of modifiers latches. WARNING: it is ambiguous what prevents a latch when multiple keys are *simultenously* operated together. We currently assuming that any action that is not identical to the considered latch prevents it.

  • test/data/symbols/latch
  • default partial alphanumeric_keys
    xkb_symbols "modifiers" {
    	name[Group1] = "Test latching behavior";
    
    	virtual_modifiers 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 ] };
    };