Branch
Hash :
c85c9bdc
Author :
Date :
2025-01-27T17:15:06
symbols: Allow levels with different keysyms and actions counts Contrary to groups, there is no reason for levels to restrict the same count of keysyms and actions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
default alphanumeric_keys modifier_keys
xkb_symbols "basic" {
name[1] = "Multiple actions";
virtual_modifiers Alt, Super, LevelThree;
// Multiple keysyms but no actions: OK
key <LCTL> {
symbols[1] = [ { Control_L, ISO_Group_Shift } ]
};
// Multiple actions but no keysyms: OK, but will use NoSymbol
key <RCTL> {
actions[1] = [ { SetMods(modifiers=Control), SetGroup(group=+1) } ]
};
// Multiple keysyms and matching actions
key <LVL3> {
virtualModifiers = LevelThree,
symbols[1] = [ { ISO_Level3_Shift, ISO_Group_Shift } ],
actions[1] = [ { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ]
};
// Multiple actions and matching keysyms
key <MDSW> {
virtualModifiers = LevelThree,
actions[1] = [ { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ],
symbols[1] = [ { ISO_Level3_Shift, ISO_Group_Shift } ]
};
// Different actions and keysyms count
key <LALT> {
symbols[1] = [ Alt_L ],
actions[1] = [ { SetMods(modifiers=Alt), SetGroup(group=+1) } ]
};
key <RALT> {
symbols[1] = [ { Alt_R, ISO_Group_Shift } ],
actions[1] = [ SetMods(modifiers=Alt) ]
};
key <LWIN> {
symbols[1] = [ { Super_L, ISO_Group_Shift } ],
actions[1] = [ { SetMods(modifiers=Super), SetGroup(group=+1), NoAction() } ]
};
key <RWIN> {
symbols[1] = [ { Super_R, ISO_Group_Shift , NoSymbol } ],
actions[1] = [ { SetMods(modifiers=Super), SetGroup(group=+1) } ]
};
// Incompatible categories
key <AB11> {
symbols[1] = [ { Control_L, Shift_L } ]
};
modifier_map Control { <AB11> };
key <AE13> {
symbols[1] = [ { Control_L, Shift_L } ],
actions[1] = [ { SetMods(modifiers=Control), SetMods(modifiers=Shift) } ]
};
// Various overrides, different keysyms, no explicit actions
key <AB01> { [ x ] };
key <AB01> { [ { Control_L, ISO_Group_Shift } ] };
key <AB02> { [ { Control_L, ISO_Group_Shift } ] };
key <AB02> { [ x ] };
// Various overrides, no keysyms, explicit actions
key <AB03> { actions[1] = [ SetMods(modifiers=LevelThree) ] };
key <AB03> { actions[1] = [ { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ] };
key <AB04> { actions[1] = [ { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ] };
key <AB04> { actions[1] = [ SetMods(modifiers=LevelThree) ] };
// Various overrides, different keysyms & actions
key <AB05> {
virtualModifiers = LevelThree,
symbols[1] = [ Control_L ],
actions[1] = [ SetMods(modifiers=Control) ]
};
key <AB05> {
symbols[1] = [ { ISO_Level3_Shift, ISO_Group_Shift } ],
actions[1] = [ { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ]
};
key <AB06> {
virtualModifiers = LevelThree,
symbols[1] = [ { ISO_Level3_Shift, ISO_Group_Shift } ],
actions[1] = [ { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ]
};
key <AB06> {
symbols[1] = [ Control_L ],
actions[1] = [ SetMods(modifiers=Control) ]
};
// Various overrides, same keysyms but different actions
key <AB07> {
virtualModifiers = LevelThree,
symbols[1] = [ { ISO_Level3_Shift, ISO_Group_Shift } ],
actions[1] = [ { SetMods(modifiers=Control), Private(type=254, data="foo") } ]
};
key <AB07> {
symbols[1] = [ { ISO_Level3_Shift, ISO_Group_Shift } ],
actions[1] = [ { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ]
};
// Mix various number of keysyms/actions
key <AC01> {
symbols[1] = [ ISO_Level3_Shift , { ISO_Level3_Shift, ISO_Group_Shift } ]
};
key <AC02> {
actions[1] = [ SetMods(modifiers=LevelThree), { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ]
};
key <AC03> {
symbols[1] = [ ISO_Level3_Shift , { ISO_Level3_Shift, ISO_Group_Shift } ],
actions[1] = [ SetMods(modifiers=LevelThree), { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ]
};
key <AC04> {
symbols[1] = [ { ISO_Level3_Shift, ISO_Group_Shift }, ISO_Level3_Shift ]
};
key <AC05> {
actions[1] = [ { SetMods(modifiers=LevelThree), SetGroup(group=+1) }, SetMods(modifiers=LevelThree) ]
};
key <AC06> {
symbols[1] = [ { ISO_Level3_Shift, ISO_Group_Shift }, ISO_Level3_Shift ],
actions[1] = [ { SetMods(modifiers=LevelThree), SetGroup(group=+1) }, SetMods(modifiers=LevelThree) ]
};
key <AC07> {
symbols[1] = [ ISO_Level3_Shift , { ISO_Level3_Shift, ISO_Group_Shift }, { ISO_Level3_Shift, ISO_Group_Shift } ]
};
key <AC08> {
actions[1] = [ SetMods(modifiers=LevelThree), { SetMods(modifiers=LevelThree), SetGroup(group=+1) }, { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ]
};
key <AC09> {
symbols[1] = [ ISO_Level3_Shift , { ISO_Level3_Shift, ISO_Group_Shift }, { ISO_Level3_Shift, ISO_Group_Shift } ],
actions[1] = [ SetMods(modifiers=LevelThree), { SetMods(modifiers=LevelThree), SetGroup(group=+1) }, { SetMods(modifiers=LevelThree), SetGroup(group=+1) } ]
};
// Using modifier_map (may trigger multiple interprets)
key <AD01> { symbols[1] = [ { a, b } ] };
modifier_map Shift { <AD01> };
// Our only alphanum key ✨
key <AE02> { [ 2, at ] };
};