Module kanata_parser::cfg
source · Expand description
This parses the configuration language to create a kanata_keyberon::layout::Layout
as well as
associated metadata to help with processing.
How the configuration maps to keyberon:
If the mapped keys are defined as:
(defsrc esc 1 2 3 4 )
and the layers are:
(deflayer one _ a s d _ )
(deflayer two _ a o e _ )
Then the keyberon layers will be as follows:
(xx means unimportant and _ means transparent)
layers[0] = { xx, esc, a, s, d, 4, xx… } layers[1] = { xx, _ , a, s, d, _, xx… } layers[2] = { xx, esc, a, o, e, 4, xx… } layers[3] = { xx, _ , a, o, e, _, xx… }
Note that this example isn’t practical, but (defsrc esc 1 2 3 4)
is used because these keys
are at the beginning of the array. The column index for layers is the numerical value of
the key from keys::OsCode
.
In addition, there are two versions of each layer. One version delegates transparent entries to the key defined in defsrc, while the other keeps them as actually transparent. This is to match the behaviour in kmonad.
The specific values in example above applies to Linux, but the same logic applies to Windows.
Modules§
- Contains all list action names and a function to check that an action name is that of a list action.
Structs§
- A global key override.
- Scratch space containing allocations used to process override information. Exists as an optimization to reuse allocations between iterations.
- A collection of global key overrides.
Enums§
Constants§
Functions§
- Parse
deftemplate
s and expandtemplate-expand
s. - Parse a new configuration from a file.
- Parse configuration entries from an expression starting with defcfg.
- Parses mod keys like
C-S-
. Returns theKeyCode
s for the modifiers parsed and the unparsed text after any parsed modifier prefixes.