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 3 of 4

0.6.0

This release focuses mostly on improvements to keymap parsing, to reduce the amount of manual tweaking necessary before drawing and better accomodate an end-to-end, parse-then-draw workflow.

Fixes
- Fixed layout size calculation so that the dimensions of drawn layers in the SVG are properly adjusted when using rotated keys

Features
- Made parsing smarter to automatically determine held keys using momentary layer keys on the keymap, so the user should no longer need to manually add `type: held` specs after parsing
- Does not currently support the conditional layers feature in ZMK, or more than one way to activate the same layer
- Added a base keymap `-b/--base-keymap` parameter to `keymap parse`. This will make the parser try its best to copy your manual modifications from the base keymap to the updated one after parsing, including combo `align` and `offset` values and `type` specifiers in layer keys
- Added a `-l/--layer-names` parameter to `keymap parse` that lets you override layer names, especially useful for QMK parsing where there is no layer name information in the parse input json
- Added `parse_config.zmk_combos` configuration to let the user automatically augment the parse output for combos, specified by the node name in the ZMK keymap, e.g. `combo_esc: {align: top, offset: 0.5}`
- Added `parse_config.sticky_label` configuration to let the user change the "sticky" display text for sticky/one-shot keys

Misc
- Added a simple Github workflow for linting
- Added `fingerpunch/ffkb` and `fingerpunch/luakeeb` physical layouts

Looking forward, Lugoues is working on integrating custom SVG glyphs to be used a legends in the drawing output in 12 and 17 so users will no longer be limited to using unicode text and symbols!

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

0.5.0

The highlight of this release is automatic physical layout detection for most ZMK keyboards, as determined by the keymap filename. For instance parsing `corne.keymap` [will add](https://github.com/caksoylar/keymap-drawer/blob/a02814e/resources/zmk_keyboard_layouts.yaml#L27) a `layout: {qmk_keyboard: crkbd/rev1, qmk_layout: LAYOUT_split_3x6_3}` field to the output keymap YAML, so you won't have to manually specify it during `keymap draw`. (There is no support yet for determining the correct `qmk_layout` via the chosen matrix transform.)

To support more ZMK (and custom QMK) keyboards, I also started maintaining some extra physical layout definitions under the [`resources` folder](https://github.com/caksoylar/keymap-drawer/tree/main/resources/qmk_layouts). If a `qmk_keyboard` name matches one of the files here then that will be used rather than checking QMK keyboards API. For example, if you use `keymap draw -k corne_rotated` instead of `crkbd/rev1` you will get a [Corne layout with nicely rotated thumb keys](https://caksoylar.github.io/keymap-drawer?keymap_yaml=H4sIAAAAAAAC_2WPS0-DQBSF9_0VJ2zcXHXRuGFHC62PPlRolTaGUDoK6VhwmCYSw38vA1NCcDU55zv33Ds8LNKTNAfAz_chOLBil4ZibyJKxZEFIpWhZHtNeZPFzPKXKy_IM57IYPh7FwwHFWIiVzW2M1EPcI3tC-GN4BBeCR7BJ6wID4Ql4fnjEvqLTYyl4ISq2ioJypieklq7Wltc1trW2o2Tz8aZVM6UcN_3H3uTT73mmdbtauPKKNujNoR3wpiwJowIC8KcYJBBuCHcXmJtH1SBF-6qoiJjJr7iNJdlJ9VsUSknj7pgYa31-MjNwoh1mevPNfuP2n86R8lEF9UfrqdsxplkvZvORV3F4vEBAAA%3D).

See the newly updated [`layout` section in the keymap spec](https://github.com/caksoylar/keymap-drawer/blob/main/KEYMAP_SPEC.md#layout) for details.

Features
- Automatically determine physical layouts for most ZMK keyboards during parsing
- Mapped from keymap filename using [the mapping file](https://github.com/caksoylar/keymap-drawer/blob/main/resources/zmk_keyboard_layouts.yaml)
- Contributions welcome to add mappings for custom ZMK keyboards/shields!
- Add custom physical layout definitions for non-QMK-upstream keyboards
- Maintained under [`resources/qmk_layouts`](https://github.com/caksoylar/keymap-drawer/tree/main/resources/qmk_layouts)
- Contributions welcome to support more keyboards! See [Keymap Layout Helper](https://nickcoutsos.github.io/keymap-layout-tools/) and [other resources](https://github.com/caksoylar/keymap-drawer/blob/main/KEYMAP_SPEC.md#layout) to help generate new layouts.
- Make `qmk_keycode_map`/`zmk_keycode_map` support key spec dicts (e.g. including `hold` or `shifted` fields), e.g. `SLASH: {t: '/', shifted: '?'}`
- Assign CSS class `layer-<layer_name>` to each layer so they can be styled individually through [`svg_style`](https://github.com/caksoylar/keymap-drawer/blob/main/keymap_drawer/config.py#L54) (thanks manna-harbour!)

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.4.0...v0.5.0

0.4.0

This release adds rotation center `rx, ry` support to QMK-format physical layouts, consistent with the handling of [`keymap-editor`](https://github.com/nickcoutsos/keymap-editor) and [Keymap Layout Helper](https://nickcoutsos.github.io/keymap-layout-tools/) (and KLE). Note that at the moment the default rotation center is key center if former are not specified, different from aforementioned tools which use top left corner, or `0, 0` origin that KLE uses ([related issue](https://github.com/nickcoutsos/keymap-editor/issues/76)).

There is also an important bug fix for parsing with the columns specifier and contributions by jbarr21 for improved parsing of QMK keymaps (thanks!).

Fixes
- Fix keymap parse dumping when `-c/--columns` value is specified to a non-default value
- Ignore labels `label: nodename` when looking for `keymap`, `behaviors` etc. nodes in ZMK keymaps

Features
- Support `rx, ry` fields in QMK info.json for specifying the point around which the angle `r` will be used to rotate
- Replace underscores with spaces in unmapped QMK keys by jbarr21 in https://github.com/caksoylar/keymap-drawer/pull/5
- Add parsing for QMK one-shot mods & layers by jbarr21 in https://github.com/caksoylar/keymap-drawer/pull/4

New Contributors
* jbarr21 made their first contribution in https://github.com/caksoylar/keymap-drawer/pull/5

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.3.0...v0.4.0

0.3.0

This update focuses on cleaning up the styling of the drawn elements by refactoring the CSS classes+other `DrawConfig` settings, and how the elements are assigned classes in the CSS. Thanks to manna-harbour for significant contributions on the design and implementation!

Features

- Overhaul CSS classes and allow specifying custom key types
- Make SVG classes used for `<rect>`'s and `<text>`'s better composable by splitting key types and label types
- Remove literal restrictions from `type` field and add the same field to combo specs. This allows users to specify a custom type for keys/combos and define it in the CSS if they want to customize certain keys/combos.
- This is a **breaking change** due to `draw_config.svg_style` being rewritten, along `draw_config.line_spacing` getting repurposed. If you have any existing configuration files you need to adapt them: See the changes in the default configuration [here](https://github.com/caksoylar/keymap-drawer/compare/v0.2.0...v0.3.0#diff-64a476d4c97f07c0a7eff43a8d18b6f88d469b1321f791a7f8b3fa60f95f0f16).
- Auto-align tap labels inside a key up/down to when it has 2 lines and either hold or shifted label is present
- Add a new config `draw_config.append_colon_to_layer_header` to be able to disable appending colons after layer names
- Darken default key outline by 5% to improve contrast

Web app

- Move to streamlit 0.18, update caching and button styling using new functionality
- Read example keymaps with a different method to reduce random loading problems at startup

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.2.0...v0.3.0

0.2.0

Fixes

- Fix `SQT` and `COLON` mappings in `zmk_keycode_map` (thanks crides)
- Correctly use `bindings` rather than `sensor-bindings` when parsing ZMK keymaps

Features

- Add `shifted` field in key spec (alias `s`) so you can draw mod-morphs/key overrides at the top of the key
- See [Miryoku example](examples/miryoku.yaml)
- These are not parsed from keymaps yet, might be added to ZMK parsing in the future
- Add `--keys-only`, `--combos-only` flags to `keymap draw` to only draw layer keys/combos, `-s`/`--select-layers` to only draw certain layers
- Make `tap` property optional in key spec, so e.g. `{type: held}` works
- Convert examples and YAML dumps to two indents to ease editing

Web app

- Surface errors to users better
- Change parsing layout and make each mode use submitted forms to reduce wonky behavior
- Add query params for parse parameters and permalink generator to link to exact keymap
- Use GitHub APIs to fetch ZMK config rather than download URLs

**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.1.2...v0.2.0

0.1.2

What's Changed
* Correct LBKT direction by jcmkk3 in https://github.com/caksoylar/keymap-drawer/pull/1

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.