-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
symbols: Add tests for multiple actions per level
- Loading branch information
Showing
3 changed files
with
322 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
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 } ] | ||
}; | ||
|
||
// Incompatible actions and keysyms count: error | ||
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) } ] | ||
}; | ||
|
||
// Our only alphanum key ✨ | ||
key <AE02> { [ 2, at ] }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters