Skip to content

Commit dbb015c

Browse files
committed
add RMK documentation
1 parent ed9deff commit dbb015c

File tree

2 files changed

+53
-4
lines changed

2 files changed

+53
-4
lines changed

CONFIGURATION.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,45 @@ _Type:_ `dict[str, str | dict]`
364364

365365
_Default:_ See [`config.py`](keymap_drawer/config.py)
366366

367+
#### `rmk_combos`
368+
369+
Mapping to augment the output field for parsed combos. Combos are identified by their 'output' value (the key that gets produced) in the keymap and the value is a dict containing fields from the [`ComboSpec`](KEYMAP_SPEC.md#combos)
370+
371+
E.g. `{"Esc": {"align": "top", "offset": 0.5}}` would add these two fields to the output for the combo defined as:
372+
373+
```rust
374+
[behavior.combo]
375+
timeout = "25ms"
376+
combos = [
377+
{ actions = [
378+
"MT(S, LAlt)",
379+
"MT(T, LGui)",
380+
], output = "Esc", layer = 0 },
381+
]
382+
```
383+
384+
A more thorough example:
385+
386+
```yaml
387+
# RMK combo configuration for better visual separation
388+
rmk_combos:
389+
"WM(V, LGui)":
390+
key: $$mdi:content-paste$$
391+
"CapsLock":
392+
draw_separate: true
393+
"OSL(3)":
394+
p: [9, 10, 11, 12, 13, 14]
395+
draw_separate: true
396+
key: $$mdi:arrow-u-down-left$$
397+
"OSM(LShift)":
398+
draw_separate: true
399+
key: $$mdi:apple-keyboard-shift$$
400+
```
401+
402+
_Type:_ `dict[str, dict]`
403+
404+
_Default:_ `{}`
405+
367406
#### `zmk_remove_keycode_prefix`
368407

369408
Remove these prefixes from ZMK keycodes before further processing.

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![PyPI version](https://img.shields.io/pypi/v/keymap-drawer.svg)](https://pypi.org/project/keymap-drawer/)
66

7-
Parse QMK & ZMK keymaps and draw them in vector graphics (SVG) format, with support for visualizing hold-taps and combos that are commonly used with smaller keyboards.
7+
Parse QMK, RMK & ZMK keymaps and draw them in vector graphics (SVG) format, with support for visualizing hold-taps and combos that are commonly used with smaller keyboards.
88

99
Available as a [command-line tool](#command-line-tool-installation) or a [web application](https://caksoylar.github.io/keymap-drawer).
1010

@@ -20,7 +20,7 @@ Available as a [command-line tool](#command-line-tool-installation) or a [web ap
2020
- Uses a human-editable YAML format for specifying the keymap
2121
- Non-adjacent or 3+ key combos can be visualized by specifying its positioning relative to the keys, with automatically drawn dendrons to keys
2222
- Alternatively, output a separate diagram per combo if you have tricky key position combinations
23-
- **Bootstrap** the YAML representation by automatically **parsing** QMK or ZMK keymap files
23+
- **Bootstrap** the YAML representation by automatically **parsing** QMK, RMK or ZMK keymap files
2424
- Arbitrary **physical keyboard layouts** (with rotated keys!) supported, along with parametrized ortho layouts
2525
- Both parsing and drawing are **customizable** with a config file
2626
- Use **custom SVG icons** for legends, in addition to unicode text
@@ -82,7 +82,7 @@ See [the development section](#development) for instructions to install from sou
8282
8383
### Bootstrapping your keymap representation
8484

85-
**`keymap parse`** command helps to parse an existing QMK or ZMK keymap file into the keymap YAML representation the `draw` command uses to generate SVGs.
85+
**`keymap parse`** command helps to parse an existing QMK, RMK or ZMK keymap file into the keymap YAML representation the `draw` command uses to generate SVGs.
8686
`-c`/`--columns` is an optional parameter that specifies the total number of columns in the keymap to better reorganize output layers.
8787

8888
- **QMK**: Only json-format keymaps are supported, which can be exported from [QMK Configurator](https://config.qmk.fm/), converted from `keymap.c` via [`qmk c2json`](https://docs.qmk.fm/#/cli_commands?id=qmk-c2json), or from a VIA backup json via [`qmk via2json`](https://docs.qmk.fm/#/cli_commands?id=qmk-via2json):
@@ -98,6 +98,14 @@ See [the development section](#development) for instructions to install from sou
9898
Due to current limitations of the `keymap.json` format, combos and `#define`'d layer names will not be present in the parsing output.
9999
However you can manually specify layer names using the layer names parameter, e.g. `keymap parse --layer-names Base Sym Nav ...`.
100100

101+
- **RMK**: `keyboard.toml` files are used for parsing.
102+
103+
```sh
104+
keymap parse -c 10 -r ~/rmk/keyboard.toml >sweep_keymap.yaml
105+
```
106+
107+
Currently combos, hold-taps, sticky keys and layer names can be determined via parsing.
108+
101109
- **ZMK**: `.keymap` files are used for parsing. These will be preprocessed similar to the ZMK build system, so `#define`'s and `#include`s will be expanded.
102110

103111
```sh
@@ -144,7 +152,8 @@ And you are done! You can view the output SVG on your browser or use a tool like
144152
>
145153
> If you like you can override the layout specification on the command line.
146154
> For instance you can provide a QMK keyboard name with `-k`/`--qmk-keyboard` and layout with `-l`/`--layout-name`,
147-
> or an ortho layout with `--ortho-layout` (using YAML syntax for the value) or `-n`/`--cols-thumbs-notation`.
155+
> or an ortho layout with `--ortho-layout` (using YAML syntax for the value) or `-n`/`--cols-thumbs-notation`.
156+
> Or, use `-j`/`--qmk-info-json` with the `info.json` generated from your `*.kicad_pcb` by clicking `import` [here](https://nickcoutsos.github.io/keymap-layout-tools/).
148157
> See `keymap draw --help` for details.
149158
150159
## Customization
@@ -335,6 +344,7 @@ Below are a few tools and example usages from the community that might be inspir
335344
- [possumvibes's keymap](https://github.com/possumvibes/keyboard-layout): Separate layer and combo diagrams
336345
- [infused-kim's ZMK config](https://github.com/infused-kim/zmk-config): Defines a script to [tweak the keymap](https://github.com/infused-kim/zmk-config/blob/main/keymap_img/keymap_img_adjuster.py) between parsing and drawing
337346
- [crides's Fissure write-up](https://github.com/crides/fissure): Custom physical layout with non-square keys and unique SVG styling
347+
- [sessile](https://github.com/willpuckett/sessile) RMK example replete with [Github Action](https://github.com/willpuckett/sessile/blob/main/.github/workflows/keymap.yml)
338348
- [My ZMK config](https://github.com/caksoylar/zmk-config): ...in case you are curious how I use keymap-drawer
339349

340350
If you use `keymap-drawer`, tag your Github repo with the [`keymap-drawer` topic](https://github.com/topics/keymap-drawer) and it will show up for anyone else searching for it!

0 commit comments

Comments
 (0)