Skip to content

Commit

Permalink
Adds encoder type with circle style
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksurry committed Dec 8, 2023
1 parent 176962c commit 5176ecb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion KEYMAP_SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples/tidbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ layout:

layers:
default:
- [ Esc, '*', '-']
- [ {tap: Esc, type: encoder}, '*', '-']
- ['7', '8', '9', '+']
- ['4', '5', '6']
- ['1', '2', '3', Enter]
Expand Down
5 changes: 5 additions & 0 deletions keymap_drawer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ class KeySidePars(BaseModel):
stroke-width: 2;
}
rect.encoder {
rx: 50%;
ry: 50%;
}
text {
text-anchor: middle;
dominant-baseline: middle;
Expand Down

0 comments on commit 5176ecb

Please sign in to comment.