Skip to content

Commit e22eeaa

Browse files
authored
add-keymap-drawer
Add keymap drawer
2 parents 582dd87 + 2c22572 commit e22eeaa

7 files changed

Lines changed: 2120 additions & 34 deletions

File tree

.github/workflows/draw-keymap.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Use the keymap-drawer ZMK user config workflow
2+
# https://github.com/caksoylar/keymap-drawer#setting-up-an-automated-drawing-workflow
3+
name: Draw ZMK keymaps
4+
on:
5+
workflow_dispatch: # can be triggered manually
6+
push: # automatically run on changes to following paths
7+
paths:
8+
- "config/*.keymap"
9+
- "config/*.dtsi"
10+
- "keymap_drawer.config.yaml"
11+
- ".github/workflows/draw-keymaps.yml"
12+
- "img/keymap-img/keymap_drawer.config.yaml"
13+
# - 'boards/*/*/*.keymap'
14+
15+
jobs:
16+
draw:
17+
uses: caksoylar/keymap-drawer/.github/workflows/draw-zmk.yml@main
18+
permissions:
19+
contents: write # allow workflow to commit to the repo
20+
with:
21+
keymap_patterns: "config/*.keymap" # path to the keymaps to parse
22+
config_path: "img/keymap-img/keymap_drawer.config.yaml" # config file, ignored if not exists
23+
output_folder: "img/keymap-img" # path to save produced SVG and keymap YAML files
24+
json_path: "config"
25+
# extra_keymap_yaml: "${keyboard}: 'images/keymap-img/combos.yaml'"
26+
parse_args: "" # map of extra args to pass to `keymap parse`, e.g. "corne:'-l Def Lwr Rse' cradio:''"
27+
draw_args: "" # map of extra args to pass to `keymap draw`, e.g. "corne:'-k corne_rotated' cradio:'-k paroxysm'"
28+
amend_commit: true # amend generated files to commit that produces them
29+
fail_on_error: true
30+
debug_mode: false

README.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33
![](https://github.com/thrly/thrly-corne-zmk/actions/workflows/build.yml/badge.svg)
44

5-
> This config is for a 6-col corne (wireless version from [Typeractive](https://typeractive.xyz/)), but I'm gradually trying to wittle it down to a smaller custom 36-key 5-col that I'm designing myself...
5+
This config is for a 6-col corne (wireless version from [Typeractive](https://typeractive.xyz/)), but I've consolidated to a 36-key 5col board I designed myself: [TEMPEST](https://github.com/thrly/tempest). This layout makes that transition very easy.
66

7-
For more explanations and reflections on this customization, see [my blog post](https://thrly.com/blog/thoughts-on-customising-a-split-keyboard-layout/) on this keymap.
8-
9-
> [!WARNING]
10-
> This is my personal daily driver keyboard config, it is under active development. Expect tweaking and occasional breaking changes. Documentation may be missing or out of sync with the latest commits. Proceed with caution.
7+
> For more explanations and reflections on this customization, see [my blog post](https://thrly.com/blog/thoughts-on-customising-a-split-keyboard-layout/) on this keymap.
118
129
![cat paws and keyboard closeup](./img/cat-corne.jpg)
1310

@@ -19,12 +16,14 @@ For more explanations and reflections on this customization, see [my blog post](
1916
- Mouse behavior on Nav layer
2017
- Horizontal Num layer
2118
- Thumb keys transparent on layers (for `Ctrl` and `Shift`)
19+
- `Shift` morphs `Space` to `_`. Useful for `TYPING_CAPS_VARIABLES`
2220
- Combos:
2321
- volume up / down (outer right top + middle / middle + bottom)
2422
- caps word / caps lock (`G`+`J` / `T`+`Y`)
2523
- escape (`Q`+`W`)
2624
- delete (`O`+`P`)
2725
- dash, underscore (`E`+`R`, `U`+`I`)
26+
- single quotes, double quotes (`U`+`J`, `I`+`J`)
2827
- Macros:
2928
- double-tap `>` for `=>` arrow
3029
- en-dash (` -- `) combo (`W`+`E`+`R`)
@@ -34,25 +33,9 @@ For more explanations and reflections on this customization, see [my blog post](
3433
3534
## Layers
3635

37-
### Base layer
38-
39-
![Base keymap diagram](./img/corne-base-layer.png)
40-
41-
### Symbol layer
42-
43-
![Symbol keymap diagram](./img/corne-symbol-layer.png)
44-
45-
### Nav layer
46-
47-
![Nav keymap diagram](./img/corne-nav-layer.png)
48-
49-
### Num layer
50-
51-
![Num keymap diagram](./img/corne-num-layer.png)
52-
53-
### Layer 4
36+
![keymap diagram](./img/keymap-img/corne.svg)
5437

55-
Nothing special here, left side features bluetooth connection profiles, right side has mouse controls with more room for buttons than on the Nav layer. \[TODO: add image]
38+
Drawn with [Keymap-Drawer](https://github.com/caksoylar/keymap-drawer)
5639

5740
## Other
5841

config/corne.dtsi

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Copyright (c) 2020 Pete Johanson
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*/
6+
7+
#include <dt-bindings/zmk/matrix_transform.h>
8+
9+
#include <layouts/foostan/corne/5column.dtsi>
10+
#include <layouts/foostan/corne/6column.dtsi>
11+
12+
&foostan_corne_6col_layout {
13+
transform = <&default_transform>;
14+
};
15+
16+
&foostan_corne_5col_layout {
17+
transform = <&five_column_transform>;
18+
};
19+
20+
/ {
21+
chosen {
22+
zephyr,display = &oled;
23+
zmk,kscan = &kscan0;
24+
zmk,physical-layout = &foostan_corne_6col_layout;
25+
};
26+
27+
default_transform: keymap_transform_0 {
28+
compatible = "zmk,matrix-transform";
29+
columns = <12>;
30+
rows = <4>;
31+
// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 |
32+
// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 |
33+
// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 |
34+
// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 |
35+
map = <
36+
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11)
37+
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11)
38+
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11)
39+
RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8)
40+
>;
41+
};
42+
43+
five_column_transform: keymap_transform_1 {
44+
compatible = "zmk,matrix-transform";
45+
columns = <10>;
46+
rows = <4>;
47+
// | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 |
48+
// | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 |
49+
// | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 |
50+
// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 |
51+
map = <
52+
RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10)
53+
RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10)
54+
RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10)
55+
RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8)
56+
>;
57+
};
58+
59+
kscan0: kscan {
60+
compatible = "zmk,kscan-gpio-matrix";
61+
wakeup-source;
62+
63+
diode-direction = "col2row";
64+
row-gpios
65+
= <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
66+
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
67+
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
68+
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
69+
;
70+
71+
};
72+
73+
// TODO: per-key RGB node(s)?
74+
};
75+
76+
&pro_micro_i2c {
77+
status = "okay";
78+
79+
oled: ssd1306@3c {
80+
compatible = "solomon,ssd1306fb";
81+
reg = <0x3c>;
82+
width = <128>;
83+
height = <32>;
84+
segment-offset = <0>;
85+
page-offset = <0>;
86+
display-offset = <0>;
87+
multiplex-ratio = <31>;
88+
segment-remap;
89+
com-invdir;
90+
com-sequential;
91+
inversion-on;
92+
prechargep = <0x22>;
93+
};
94+
};

config/corne.keymap

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
* SPDX-License-Identifier: MIT
55
*/
66

7+
78
#define ZMK_POINTING_DEFAULT_MOVE_VAL 800 // default: 600
89
#define ZMK_POINTING_DEFAULT_SCRL_VAL 20 // default: 10
9-
#define KEYS_L LT0 LT1 LT2 LT3 LT4 LT5 LM0 LM1 LM2 LM3 LM4 LM5 LB0 LB1 LB2 LB3 LB4 LB5 // Left-hand keys.
10-
#define KEYS_R RT0 RT1 RT2 RT3 RT4 RT5 RM0 RM1 RM2 RM3 RM4 RM5 RB0 RB1 RB2 RB3 RB4 RB5 // Right-hand keys.
11-
#define THUMBS LH2 LH1 LH0 RH0 RH1 RH2
1210

1311
#include <zmk-helpers/key-labels/42.h>
1412
#include <behaviors.dtsi>
@@ -42,51 +40,73 @@
4240
caps_word {
4341
bindings = <&caps_word>;
4442
key-positions = <17 18>;
43+
layers = <0>;
4544
};
4645

4746
esc {
4847
bindings = <&kp ESCAPE>;
4948
key-positions = <1 2>;
49+
layers = <0>;
5050
};
5151

5252
vol_up {
5353
bindings = <&kp C_VOLUME_UP>;
5454
key-positions = <11 23>;
55+
layers = <0>;
5556
};
5657

57-
vol_down {
58+
combo_vol_down {
5859
bindings = <&kp C_VOLUME_DOWN>;
5960
key-positions = <23 35>;
61+
layers = <0>;
6062
};
6163

62-
CAPS_LOCK {
64+
combo_CAPS_LOCK {
6365
bindings = <&kp CAPSLOCK>;
6466
key-positions = <5 6>;
67+
layers = <0>;
6568
};
6669

67-
Delete {
70+
combo_Delete {
6871
bindings = <&kp DELETE>;
6972
key-positions = <10 9>;
73+
layers = <0>;
7074
};
7175

72-
underscore {
76+
combo_underscore {
7377
bindings = <&kp UNDER>;
7478
key-positions = <7 8>;
79+
layers = <0>;
7580
};
7681

77-
dash {
82+
combo_dash {
7883
bindings = <&kp MINUS>;
7984
key-positions = <4 3>;
85+
layers = <0>;
8086
};
8187

82-
em-dash {
88+
combo_em-dash {
8389
bindings = <&emdsh>;
8490
key-positions = <2 3 4>;
91+
layers = <0>;
8592
};
8693

87-
f19 {
94+
combo_f19 {
8895
bindings = <&kp F19>;
8996
key-positions = <1 4 7 10>;
97+
layers = <0>;
98+
};
99+
100+
combo_single-quote {
101+
bindings = <&kp SINGLE_QUOTE>;
102+
key-positions = <7 19>;
103+
layers = <0>;
104+
};
105+
106+
combo_double-quote {
107+
bindings = <&kp AT_SIGN>;
108+
key-positions = <8 20>;
109+
layers = <0>;
90110
};
91111
};
92112

@@ -126,6 +146,15 @@
126146
#binding-cells = <0>;
127147
bindings = <&kp GREATER_THAN>, <&arrow_func>;
128148
};
149+
150+
underspace: underspace {
151+
compatible = "zmk,behavior-mod-morph";
152+
label = "UNDERSPACE";
153+
bindings = <&lt 1 SPACE>, <&kp UNDER>;
154+
155+
#binding-cells = <0>;
156+
mods = <(MOD_RSFT)>;
157+
};
129158
};
130159

131160
keymap {
@@ -142,7 +171,7 @@
142171
&kp LMETA &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp DELETE
143172
&kp LCTRL &bhm LMETA A &bhm LEFT_ALT S &bhm LEFT_SHIFT D &bhm LCTRL F &kp G &kp H &bhm RCTRL J &bhm RIGHT_SHIFT K &bhm LEFT_ALT L &bhm LMETA SEMICOLON &kp SQT
144173
&sk LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RIGHT_ALT
145-
&kp LCTRL &lt 1 SPACE &lt 4 TAB &lt 3 RET &lt 2 BACKSPACE &sk RIGHT_SHIFT
174+
&kp LCTRL &underspace &lt 4 TAB &lt 3 RET &lt 2 BACKSPACE &sk RIGHT_SHIFT
146175
>;
147176
};
148177

0 commit comments

Comments
 (0)