This release updates ZMK parsing to use a tree-sitter-based parser and adds support for ZMK physical layouts in devicetree format (used by Studio), among other improvements.
The new parsing implementation results in speed improvements that range from 10% shorter runtime to 7x, with a median speed-up of ~2x in my test cases.
If you encounter any new problems with parsing your keymaps, please open an issue!
Features
Drawing
- Add
dts_layout
option for physical layouts, and corresponding--dts-layout
CLI arg.- This is analogous to
qmk_info_json
field pointing to a file path, except the file should contain ZMK's physical layout nodes in devicetree
- This is analogous to
- Deprecated
qmk_layout
field in physical layout definitions, and corresponding--qmk-layout
CLI arg.
Uselayout_name
instead, which also works withdts_layout
above
Parsing
- Add
parse_config.layer_legend_map
which can be used to customize how layer names are represented in the keymap- This is similar to how e.g.
zmk_keycode_map
is used to change keycode representations, but applied to layer names instead
- This is similar to how e.g.
- Switch to a
tree-sitter-devicetree
-based parser for ZMK, from the oldpyparsing
-based one - Add
--virtual-layers
CLI argument tokeymap parse
- This appends empty "virtual" layers at the end of the keymap; this can be used for assigning combos etc. to show them on a separate diagram
- Also look-up behavior prefixes in
raw_binding_map
- For example match entries like
&td
for ZMK behavior bindings like&td 0
to fix for behaviors nested in hold-taps
- For example match entries like
Fixes
- Ignore "reserved" ZMK layers while parsing, used for ZMK Studio
- Better support for Studio-related ZMK updates to come, see #125
- Switch to using Github raw URL for
mdi
glyphs, by @magicDGS in #132- The old unpkg URL was unreliable and seems to have eventually disappeared
- Add retries and a more generous timeout for fetching SVG glyphs from remote URLs
- More correctly center/normalize QMK physical layouts when there are rotated keys
ZMK drawing workflow
- Use pipx for installs in draw-zmk.yml (PEP 668) by @janwvjaarsveld in #118
- Enable extended globbing for pattern matching by @thazhemadam in #121
New Contributors
- @janwvjaarsveld made their first contribution in #118
- @thazhemadam made their first contribution in #121
- @dhruvinsh made their first contribution in #126
- @magicDGS made their first contribution in #132
Full Changelog: v0.18.1...v0.19.0