Keymap-drawer

Latest version: v0.17.0

Safety actively analyzes 638720 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

0.11.0

This release introduces a few major drawing features, automated ZMK workflow improvements and a major internal refactor to improve the project structure.

Features
- **Multiple output columns!**
- Set the `draw_config.n_columns` variable to e.g. 3 to output with three layer columns

![image](https://github.com/caksoylar/keymap-drawer/assets/7876996/406d9c49-17b0-4047-a84f-466c814c8be2)

- **Separate combo diagrams!** For those of you who use thumb+alpha combos or steno-like keymaps, there is now the option
to draw each combo in a separate minified layer diagram, showing the output key and the triggering key positions.
- Set `draw_config.separate_combo_diagrams: true` to enable, and `draw_config.combo_diagrams_scale` to tweak the scaling factor (default `2`)
- Currently the `layers` property of the combos are ignored and not visualized, might be added in the future if there is a clean way to show it
- Key corner radii are currently not scaled, so the keys will look rounder for higher scale factors

![image](https://github.com/caksoylar/keymap-drawer/assets/7876996/0f957bdc-2da2-4369-be8c-2135058e63d4)

- Add key sides to drawn keys to give a keycap "profile" appearance, by riccardoflp
- `draw_config.draw_key_sides: true` to enable, tweak the appearance via `draw_config.key_side_pars`
- Currently may not render well on Safari, looking into workarounds

![image](https://github.com/caksoylar/keymap-drawer/assets/7876996/28a91713-86bc-4ea6-b21b-fdeb1e5d970f)

Fixes
- Sort SVG glyph defs before writing to avoid non-deterministic output
- Tweak Tabler-related CSS to hide the outline boxes in Safari, by bryanforbes
- Fix font size issue in hold/shifted fields due to `draw_config.shrink_wide_legends`, by `inxi` (at MoErgo Discord)
- Fix issue creating unnecessarily long dendrons for certain combo types

ZMK drawing workflow
- Add option to amend the last commit and also commit parse output YAML, by minusfive
- Recursively checkout the repo to support git submodules like [zmk-nodefree-config](https://github.com/urob/zmk-nodefree-config), by shroomist

Misc
- Tweak classes for output SVG elements to allow for better customization via CSS
- Assign `key`/`combo` classes to rect+text elements for layout keys/combos
- Assign `keypos-N`/`combopos-N` classes to key/combo elts. to allow addressing via position index `N`
- Add a proper physical layout for `slicemk_ergodox`, by xudongzheng
- Round SVG coordinate/size values for better readability and smaller output size, by art4ride and me

Note that future updates might unfortunately include more CSS changes, such as converting to the descendants selector syntax, e.g. `.held rect { ... }` from `rect.held { ... }`. Thanks to the folks at LowProKB and MoErgo for helpful discussions.

I will also prioritize a better documentation organization in the short term, possibly hosted on Github pages.

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.10.0...v0.11.0

0.10.0

This release adds support for parsing alternative matrix transforms in ZMK like `five_column_transform` for Corne variants and other improvements.

Also check out the new ["Community" section](https://github.com/caksoylar/keymap-drawer#community) for nice projects using `keymap-drawer` to get inspired from!

Features
- Add ability to **parse selected ZMK matrix transforms** in a `chosen` node and update [ZMK layout mappings](resources/zmk_keyboard_layouts.yaml) to support different matrix-transform-to-physical-layout mappings
- **Breaking change**: Convert `draw_config.arc_scale` config param to be a [per-combo setting](KEYMAP_SPEC.mdcombos) instead of a global parameter
- **Change the default styling of `ghost` keys** to have a dashed outline rather than a dark gray fill
- You can restore it to [the old style](https://github.com/caksoylar/keymap-drawer/blob/v0.9.0/keymap_drawer/config.py#L84) in `draw_config.svg_style` if needed
- Make params of `&bt` such as `BT_SEL` mappable in `parse_config.zmk_keycode_map` by minusfive in https://github.com/caksoylar/keymap-drawer/pull/28
- **Warning**: This will be refactored and these parameters will likely be supported under a different section soon, and `zmk_keycode_map` be reserved for keycodes only
- Add a new **`-g`/`--ghost-keys` option** to `keymap draw` to programmatically assign `type: ghost` to given key positions before drawing

Fixes
- Devicetree parser now uses the last value if a property is defined multiple times, like Zephyr
- Devicetree parser no longer fails with `parse_config.preprocess: false`

Misc
- The web app code is moved to a different project, https://github.com/caksoylar/keymap-drawer-web
- As a result the Streamlit URL changed as well; note that https://caksoylar.github.io/keymap-drawer will always redirect to the latest, so I encourage using that link
- Overhaul [examples](examples/) to use more combo-related features and SVG glyphs
- Add and use `lily58_rotated` physical layout with properly rotated thumb keys, by Nicell
- Default to `corne_rotated` physical layout for all Corne variants
- Add mappings for custom shields in https://github.com/JonMuller/gerbers, `lpgalaxy_war_driver`, `lpgalaxy_blank_slate`, `technikable` and a few more
- Improve physical layouts coverage for boards/shields in the ZMK repo

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.9.0...v0.10.0

0.9.0

This release builds upon v0.8.0 to further improve ZMK parsing with conditional layers support and a bug fix.

Features
- Add conditional layers parsing for ZMK keymaps, so that `held` keys are automatically inferred for the target layers as well

Fixes
- Parse the built-in ZMK mod-morph `&gresc`

Misc
- For the [reusable ZMK workflow](.github/workflows/draw-zmk.yml): discover matching layout data in config/ by nickcoutsos in https://github.com/caksoylar/keymap-drawer/pull/26
- This is for config repos that have `.json` file(s) used by [`keymap-editor`](https://github.com/nickcoutsos/keymap-editor) next to the keymap files: the drawing workflow will automatically use that file for determining the physical layout
- Fix `adv360` layout definition to be consistent with upstream changes removing dummy key positions

New Contributors
- nickcoutsos made their first contribution in https://github.com/caksoylar/keymap-drawer/pull/26

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.8.0...v0.9.0

0.8.0

This release has a few improvements mainly related to ZMK keymap parsing, including support for mod-morphs and custom sticky keys.

Features
- **Refactored ZMK parsing** to use `compatible` fields to determine nodes of interest
- Previously we relied on other heuristics based on node names, which were usually satisfied by convention. Current approach emulates Zephyr's parsing so any keymap that works with ZMK should now be parsed correctly
- The new [`dts.py` module](keymap_drawer/dts.py) is a parser that can be used standalone for other ZMK-related projects
- Added **parsing for mod-morphs**, which assigns the morphed behavior to the `shifted` field
- Added **parsing for custom sticky key behaviors**, in addition to the built-ins `&sk`/`&sl`
- Made **hold-taps parse its bindings recursively** (similar to the above two), so that its output is more accurate
- Previously this also relied on heuristics that mostly worked for `&kp/&kp` and `&mo/&kp` hold-taps
- Added a new drawing config `draw_config.shrink_wide_legends` (enabled by default) to **automatically shrink legends that are too wide**
- This is currently not designed ideally, since the optimal value depends on the font size and rect/combo box width. The default value should work well with other defaults, but it is not ideal for combo boxes. I thought it is still a good improvement but I will re-implement this if I can come up with a better way. **Feedback is welcome!**

Fixes
- Run the keys of `parse_config.raw_binding_map` through the preprocessor before using them (11)
- This fixes cases like `raw_binding_map: {"&lt NUM ESC": "my hold-tap"}` where `NUM` gets replaced by a preprocessor define

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.7.1...v0.8.0

0.7.1

This is a bug fix release for the changes related to features introduced in v0.7.0.

Fixes
- Allow unicode characters in dumped YAMLs, e.g. to output `▽` instead of `"\u25BD"`
- Do not clear legends for held keys during keymap parsing unless it is transparent (23)
- Outputs for inferred `held` keys are now as it was before v0.7.0
- Increase compatibility of embedded custom SVGs with Inkscape 1.2.2 and before

Web app
- Expand the configuration section by default, to work around the issue where the configuration text box is occasionally empty

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.7.0...v0.7.1

0.7.0

This is a large and overdue update, with various improvements to both parsing and drawing functionality. Highlight of this update is the ability to integrate custom SVG glyphs which can be automatically fetched from a number of fixed sources like [Tabler](https://tabler-icons.io/) or [MDI](https://pictogrammers.com/library/mdi/).

Features
- Added the ability to use custom SVG glyphs as key legends by Lugoues, see [the README section](https://github.com/caksoylar/keymap-drawer/blob/main/README.md#custom-glyphs) for details and [`showcase.yaml`](https://github.com/caksoylar/keymap-drawer/blob/main/examples/showcase.yaml) for an example
- SVG glyphs can be defined in the `draw_config.glyphs` field of the configuration, or fetched from URLs
- Four icon sources are currently supported for automated fetching with a short-hand, e.g. [`$$tabler:volume$$`](https://tabler-icons.io/i/volume)
- Fetched SVGs are cached in a user cache folder to speed up consequent runs
- Added a `slide` field to the [combo definitions](https://github.com/caksoylar/keymap-drawer/blob/main/KEYMAP_SPEC.md#combos) to allow more flexible combo positioning, with expected value between -1 and 1
- Changing this value "slides" the combo box along an axis between keys -- can be used for moving `top`/`bottom` combo boxes left/right, `left`/`right` boxes up/down, or `mid` combos between two keys
- `keymap parse` now outputs a symbol `▽` for transparent keys and assigns it a CSS class that grays out the legend by default
- Configurable via `parse_config.trans_legend` value
- Added a reusable Github workflow to automatically generate keymap SVGs in ZMK user config repos
- See [the section in README](https://github.com/caksoylar/keymap-drawer#setting-up-an-automated-drawing-workflow) on how to integrate to your own config repo

Fixes
- Fixed unnecessary drawing of combo arcs, which are usually hidden behind the combo box

Misc
- Added physical layouts for `dao`, `glove80` and `adv360`, latter using the 84 binding transform used in [the official config](https://github.com/KinesisCorporation/Adv360-Pro-ZMK)
- Added a `devcontainer` for development in VS Code, by Lugoues

New Contributors
- Various contributions detailed above by Lugoues
- calumy made their first contribution in https://github.com/caksoylar/keymap-drawer/pull/19

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.6.0...v0.7.0

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.