Keymapviz
Keymapviz can convert keymap.c in qmk_firmware to ascii art or json file.
Following keyboards are supported.
- crkbd
- dactyl_manuform5x6
- dactyl_manuform6x6
- ergo42
- ergodash (layout:
default,2u_inner) - ergodone(ergodox)
- ergodox_ez(ergodox)
- fortitude60
- helix
- id75
- kaishi65
- kinesis
- kyria
- lets_split
- lily58
- mint60
- moonlander
- planck (layout:
default(=grid),mit) - sofle
- sweet16
Install
Keymapviz works with Python3.
$ pip3 install keymapviz
Usage
Output ascii art
$ keymapviz qmk_firmware/keyboards/ergodox_ez/keymaps/default/keymap.c
/*
*
* .---------------------------------------------. .---------------------------------------------.
* | EQL | 1 | 2 | 3 | 4 | 5 | LEFT | ! RGHT | 6 | 7 | 8 | 9 | 0 | MINS |
* !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
* | DELT | Q | W | E | R | T |TG(SYMB| !TG(SYMB| Y | U | I | O | P | BSLS |
* !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
* | BSPC | A | S | D | F | G |-------! !-------! H | J | K | L |LT(MD|GUI_T(K|
* !-------+-----+-----+-----x-----x-----!ALL_T(K! !MEH_T(K!-----x-----x-----+-----+-----+-------!
* | LSFT |CTL_T| X | C | V | B | | ! | N | M |COMM | DOT |CTL_T| RSFT |
* '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
* |LT(SYM|QUOT |LALT(|LEFT |RGHT | ! UP |DOWN |LBRC |RBRC | FN1 |
* '------------------------------' '------------------------------'
* .---------------. .---------------.
* |ALT_T(K| LGUI | ! LALT |CTL_T(K|
* .-------+-------+-------! !-------+-------+-------.
* ! SPC ! BSPC | HOME | ! PGUP | TAB ! ENT !
* ! ! !-------! !-------! ! !
* | | | END | ! PGDN | | |
* '-----------------------' '-----------------------'
*/
/*
*
* .---------------------------------------------. .---------------------------------------------.
* | VRSN | F1 | F2 | F3 | F4 | F5 | | ! | F6 | F7 | F8 | F9 | F10 | F11 |
* !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
* | |EXLM | AT |LCBR |RCBR |PIPE | | ! | UP | 7 | 8 | 9 |ASTR | F12 |
* !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
* | |HASH | DLR |LPRN |RPRN | GRV |-------! !-------!DOWN | 4 | 5 | 6 |PLUS | |
* !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
* | |PERC |CIRC |LBRC |RBRC |TILD | | ! |AMPR | 1 | 2 | 3 |BSLS | |
* '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
* | EPRM | | | | | ! | DOT | 0 | EQL | |
* '------------------------------' '------------------------------'
* .---------------. .---------------.
* |RGB_MOD| | !RGB_TOG|RGB_SLD|
* .-------+-------+-------! !-------+-------+-------.
* !RGB_VAD!RGB_VAI| | ! |RGB_HUD!RGB_HUI!
* ! ! !-------! !-------! ! !
* | | | | ! | | |
* '-----------------------' '-----------------------'
*/
/*
*
* .---------------------------------------------. .---------------------------------------------.
* | | | | | | | | ! | | | | | | |
* !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
* | | | |MS_U | | | | ! | | | | | | |
* !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
* | | |MS_L |MS_D |MS_R | |-------! !-------! | | | | | MPLY |
* !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
* | | | | | | | | ! | | |MPRV |MNXT | | |
* '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
* | | | |BTN1 |BTN2 | !VOLU |VOLD |MUTE | | |
* '------------------------------' '------------------------------'
* .---------------. .---------------.
* | | | ! | |
* .-------+-------+-------! !-------+-------+-------.
* ! ! | | ! | ! WBAK !
* ! ! !-------! !-------! ! !
* | | | | ! | | |
* '-----------------------' '-----------------------'
*/
Legend replacements
A config file containing legend replacements can be provided to change the legends to your liking. It should have a section named 'legends' and e.g. look like:
[legends]
KC_BLSLS=\
KC_QUOT='
It can then be provided on the commandline like:
$ keymapviz qmk_firmware/keyboards/lets_split/keymaps/default/keymap.c -c /path/to/config.properties
An example file is provided in the root of this project, named config.properties.
Output json file. This json file can be used in http://www.keyboard-layout-editor.com/.
$ keymapviz qmk_firmware/keyboards/lets_split/keymaps/default/keymap.c -t json -o 'lets_split{}.json'
$ ls lets_split*.json
lets_split0.json lets_split1.json lets_split2.json lets_split3.json lets_split4.json lets_split5.json
Output fancy ascii art
Uses unicode symbols for drawing the box outlines.
$ keymapviz -t fancy qmk_firmware/keyboards/kbdclack/kaishi65/keymaps/default/keymap.c
/*┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬────┐
*│ES │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ MI│ EQ│ BS │ GR │
*├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼────┤
*│ TA │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ LB│ RB│ BS │ DE │
*├─────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─────┼────┤
*│ CA │ A │ S │ D │ F │ G │ H │ J │ K │ L │ SC│ QU│ EN │ PG │
*├───────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┬───┼────┤
*│ LS │ Z │ X │ C │ V │ B │ N │ M │ CO│ DO│ SL│ RS │ UP│ PG │
*├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴─┬─┴─┬─┴─┬─┴──┬───┼───┼────┤
*│ LC │ LG │ LA │ SP │ RA│ MO│ RC │ LE│ DO│ RG │
*└────┴────┴────┴───────────────────────┴───┴───┴────┴───┴───┴────┘
* generated by [keymapviz]
*/
/*┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬────┐
*│ │ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│ F1│ F1│ F1│ DE │ │
*├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼────┤
*│ │ BT│ MS│ BT│ │ │ │ │ │ │ │ │ │ │ IN │
*├─────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─────┼────┤
*│ │ MS│ MS│ MS│ │ │ │ │ │ │ │ │ │ HO │
*├───────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┬───┼────┤
*│ │ │ │ │ │ │ │ MU│ │ │ │ │ VO│ EN │
*├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴─┬─┴─┬─┴─┬─┴──┬───┼───┼────┤
*│ │ │ │ │ │ │ │ MP│ VO│ MN │
*└────┴────┴────┴───────────────────────┴───┴───┴────┴───┴───┴────┘
* generated by [keymapviz]
*/
Replace ascii-art in keymap.c
Generate backup as keymap.c.bac
$ keymapviz -r keymap.c
Contributing
Please see CONTRIBUTING.md.
License
This software is released under the MIT License, see LICENSE.
Metadata
Release files for keymapviz 1.14.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| keymapviz-1.14.1.tar.gz | 24.7 kB | Without provenance | Details for keymapviz-1.14.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| keymapviz-1.14.1-py3-none-any.whl | Python 3 | none | any | Details for keymapviz-1.14.1-py3-none-any.whl |
Total release size: 57.5 kB
Release files / keymapviz-1.14.1.tar.gz
| Download URL | keymapviz-1.14.1.tar.gz |
|---|---|
| Size | 24.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3377b55801f09ff002c27b94fece166c54260115aad6e743d53ff7c4ff8b6582
|
|
BLAKE2b-256 checksum How to use checksums |
f2b78ff37e1f6ccfe16f38fba2a115b12ffbafc91606c55b67d5e33ad471219b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.16
|
Release files / keymapviz-1.14.1-py3-none-any.whl
| Download URL | keymapviz-1.14.1-py3-none-any.whl |
|---|---|
| Size | 32.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d01eb8949fe6eeb9539efcb9f0bec79c9feee51e5ddbfb6682c96ad2285f94f0
|
|
BLAKE2b-256 checksum How to use checksums |
3b20e5834fed1119112ba08ff4bf3c21b1e718e076073314c8db5b9a1350beb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.16
|
Security for keymapviz 1.14.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.