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
- ferris
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.