diff --git a/KEYMAP_SPEC.md b/KEYMAP_SPEC.md index f18f5ad..ddcb94d 100644 --- a/KEYMAP_SPEC.md +++ b/KEYMAP_SPEC.md @@ -113,7 +113,7 @@ A `LayoutKey` can be defined with either a string value or with a mapping with t | `tap (t)` | `str` | `""` | the tap action of a key, drawn on the center of the key; spaces will be converted to line breaks[^2] | | `hold (h)` | `str` | `""` | the hold action of a key, drawn on the bottom of the key | | `shifted (s)` | `str` | `""` | the "shifted" action of a key, drawn on the top of the key | -| `type` | `str` | `""` | the styling of the key that corresponds to the [SVG class](CONFIGURATION.md#svg_style)[^3]. predefined types are `held` (a red shading to denote held down keys), `ghost` (dashed outline to denote optional keys in a layout), `trans` (lighter text for transparent keys) | +| `type` | `str` | `""` | the styling of the key that corresponds to the [SVG class](CONFIGURATION.md#svg_style)[^3]. predefined types are `held` (a red shading to denote held down keys), `ghost` (dashed outline to denote optional keys in a layout), `trans` (lighter text for transparent keys), and `encoder` (circled outline) | [^2]: You can prevent line breaks by using double spaces `" "` to denote a single non-breaking space. [^3]: Text styling can be overridden in the SVG config using the `"tap"`, `"hold"` and `"shifted"` classes if desired. diff --git a/examples/tidbit.yaml b/examples/tidbit.yaml index 5640b73..1cbb93c 100644 --- a/examples/tidbit.yaml +++ b/examples/tidbit.yaml @@ -9,7 +9,7 @@ layout: layers: default: - - [ Esc, '*', '-'] + - [ {tap: Esc, type: encoder}, '*', '-'] - ['7', '8', '9', '+'] - ['4', '5', '6'] - ['1', '2', '3', Enter] diff --git a/keymap_drawer/config.py b/keymap_drawer/config.py index 78a0cc1..f8aa9c6 100644 --- a/keymap_drawer/config.py +++ b/keymap_drawer/config.py @@ -125,6 +125,11 @@ class KeySidePars(BaseModel): stroke-width: 2; } + rect.encoder { + rx: 50%; + ry: 50%; + } + text { text-anchor: middle; dominant-baseline: middle;