You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PORTING.md
+57-56Lines changed: 57 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,24 @@
1
1
# Porting a Keyboard to support Halcyon Modules
2
2
3
+
Before continuing, complete the setup described in the main README.
4
+
3
5
This guide can be used for both a keyboard design with a **Halcyon and VIK connector** or the **Halcyon to Promicro adapter**.
4
6
5
7
If you want to use the Splitkb Halcyon modules (Encoder, TFT Display, Cirque Trackpad) on a keyboard that doesn't natively support them yet, you will need to prepare its QMK configuration.
6
8
7
-
Because Halcyon modules hook into the keyboard by acting as **5 extra keys per microcontroller**, the keyboard's `keyboard.json` and `info.json` matrix and layouts must be expanded to accommodate them.
9
+
# Adding support for Halcyon Modules (Except Halcyon Encoders)
10
+
11
+
> **⚠️** If you want to support Halcyon Encoders, please read the steps [below](#adding-support-for-halcyon-encoders). If you only plan on using any other modules, you won't need to follow those steps.
12
+
13
+
Create or copy your keymap to this repository.
14
+
15
+
Within the keymap folder, add `USER_NAME := halcyon_modules` to the `rules.mk`. If you're using the Halcyon to Promicro adapter, also add `CONVERT_TO=halcyon` to the `rules.mk`. Create the file if it doesn't exist yet.
8
16
9
-
By doing this inside your cloned `splitkb/qmk_userspace`, you keep your modifications clean and separate from the main QMK/Vial repositories!
17
+
You can now compile using the steps from the main readme.
10
18
11
-
---
19
+
# Adding support for Halcyon Encoders
20
+
21
+
Because the Halcyon Encoder module hook into the keyboard by acting as **1 extra keys per microcontroller**, the keyboard's `keyboard.json` and `info.json` matrix and layouts must be expanded to accommodate them. We accomodate for **5 extra keys** to provide easier support when new modules may release in the future.
12
22
13
23
## 1. Prepare your Userspace Overlay
14
24
If the keyboard does not exist in the userspace yet, you must create an overlay for it. This overlay lives in your userspace and uses the `_hlc` suffix to indicate a modified keyboard.
@@ -25,10 +35,10 @@ Which one you use depends on how the keyboard is structured:
25
35
26
36
Copy all files normally required to compile the keyboard (such as `keyboard.json`, `rules.mk`, `config.h`, etc.). Place your modified `keyboard.json` and any other altered files in this overlay. The GitHub CI will automatically merge this overlay with the base keyboard when using the revision folder from the main repository during the build process. Otherwise it will compile the new keyboard completely.
27
37
28
-
Also make sure to copy over the keymap folder.
38
+
Also make sure to copy over the keymap folder. Within the keymap folder, add `USER_NAME := halcyon_modules` to the `rules.mk`. If you're using the Halcyon to Promicro adapter, also add `CONVERT_TO=halcyon` to the `rules.mk`. Create the file if it doesn't exist yet.
29
39
30
-
## 2. Register the Encoder Engine
31
-
Even if you are compiling for a trackpad or TFT display, QMK needs the encoder engine initialized. We do this by defining a dummy encoder.
40
+
## 2. Register encoder support.
41
+
Even if you are compiling for a trackpad or TFT display, QMK needs the encoder initialized. We do this by defining a dummy encoder.
32
42
33
43
In your `keyboard.json`, add a `"rotary"` array under `"encoder"` using `"NO_PIN"`:
34
44
@@ -40,7 +50,7 @@ In your `keyboard.json`, add a `"rotary"` array under `"encoder"` using `"NO_PIN
40
50
}
41
51
```
42
52
43
-
If the keyboard already has an encoder, append the dummy one to the existing array:
53
+
If the keyboard already has an encoder, append the dummy one to the existing array. You may also need to do this in the `"split"` array if that exists:
44
54
45
55
```json
46
56
"encoder": {
@@ -49,6 +59,14 @@ If the keyboard already has an encoder, append the dummy one to the existing arr
@@ -73,48 +91,49 @@ Find the `"matrix_pins"` block. Add `"NO_PIN"` to the end of the `"rows"` array.
73
91
}
74
92
}
75
93
```
76
-
*Tip: If your matrix uses a `"direct"` 2D array instead of rows/cols, add a completely new array row filled with 5 `"NO_PIN"` values (e.g., `["NO_PIN", "NO_PIN", "NO_PIN", "NO_PIN", "NO_PIN"]`).*
77
94
78
-
## 4. Rename and Expand the Layout
79
-
To avoid conflicts and explicitly use this new configuration, rename the layout key inside the `"layouts"` block (e.g., change `"LAYOUT"` or `"LAYOUT_split_3x6_3"` to `"LAYOUT_hlc"`).
95
+
## 4. Shift Right-Half Matrix Indices (Split Keyboards Only)
96
+
Because QMK maps split keyboard matrices sequentially, adding a dummy row to the left half pushes all the original right half's rows down by 1.
97
+
98
+
For example, if your left half originally used rows `0` to `3`, your right half started at `4`. Since the left half now uses `0` to `4` (due to the added Halcyon row), the right half must now start at `5`.
99
+
100
+
1.**In your `"layouts"` block:** Look at all the *pre-existing* right-hand keys and increase their row index (the first number in the `"matrix": [row, col]` array) by `1`. *(e.g., `[4, 2]` becomes `[5, 2]`)*.
101
+
2.**In your `"rgb_matrix"` block:** If the keyboard has per-key RGB, you must do the exact same `+1` row shift for the `"layout"` array located inside `"rgb_matrix"` so the lighting correctly aligns with the shifted matrix!
102
+
103
+
*Tip: Use your text editor’s find-and-replace to update both the `"layouts"` and `"rgb_matrix"` blocks at once. Start with the highest right-hand row index and increment each by 1. For example, replace `[7` → `[8`, `[6` → `[7]`, and continue downward until you reach the original left-hand row count. For the Kyria (4 rows per half), stop at 4. This keeps the right-hand matrix and RGB layout correctly aligned after adding the Halcyon row.*
104
+
105
+
## 5. Rename and Expand the Layout
106
+
To avoid conflicts and explicitly use this new configuration, rename the layout key inside the `"layouts"` block (e.g., change `"LAYOUT"` or `"LAYOUT_split_3x6_3"` to `"LAYOUT_hlc"`). You may need to copy this `"layouts"` block from the `info.json` which is in the root of the keyboard folder.
80
107
81
108
Next, map the new Halcyon inputs to the visual layout array. You need to add **5 keys per module** (so 5 extra keys for a unibody keyboard, or 10 extra keys for a split keyboard).
82
109
83
110
Map `"matrix": [row, col]` to the new row index you just created. *(Note: arrays are 0-indexed, so if you originally had 4 rows, your new row is index `4`).* Give them a `y` coordinate that pushes them visually to the bottom of the layout.
Assuming the Left hand's new row is `4`, and the Right hand's new row is `9`. Notice how the right hand's `x` values usually count backwards to match physical mirroring.
96
123
```json
97
-
{"matrix": [4, 0], "x": 0, "y": 6},
98
-
{"matrix": [4, 1], "x": 1, "y": 6},
99
-
{"matrix": [4, 2], "x": 2, "y": 6},
100
-
{"matrix": [4, 3], "x": 3, "y": 6},
101
-
{"matrix": [4, 4], "x": 4, "y": 6},
102
-
103
-
{"matrix": [9, 0], "x": 14, "y": 6},
104
-
{"matrix": [9, 1], "x": 13, "y": 6},
105
-
{"matrix": [9, 2], "x": 12, "y": 6},
106
-
{"matrix": [9, 3], "x": 11, "y": 6},
107
-
{"matrix": [9, 4], "x": 10, "y": 6}
124
+
{"matrix": [4, 0], "x": 0, "y": 6},
125
+
{"matrix": [4, 1], "x": 1, "y": 6},
126
+
{"matrix": [4, 2], "x": 2, "y": 6},
127
+
{"matrix": [4, 3], "x": 3, "y": 6},
128
+
{"matrix": [4, 4], "x": 4, "y": 6},
129
+
130
+
{"matrix": [9, 0], "x": 14, "y": 6},
131
+
{"matrix": [9, 1], "x": 13, "y": 6},
132
+
{"matrix": [9, 2], "x": 12, "y": 6},
133
+
{"matrix": [9, 3], "x": 11, "y": 6},
134
+
{"matrix": [9, 4], "x": 10, "y": 6}
108
135
```
109
136
110
-
## 5. Shift Right-Half Matrix Indices (Split Keyboards Only)
111
-
Because QMK maps split keyboard matrices sequentially, adding a dummy row to the left half pushes all the original right half's rows down by 1.
112
-
113
-
For example, if your left half originally used rows `0` to `3`, your right half started at `4`. Since the left half now uses `0` to `4` (due to the added Halcyon row), the right half must now start at `5`.
114
-
115
-
1.**In your `"layouts"` block:** Look at all the *pre-existing* right-hand keys and increase their row index (the first number in the `"matrix": [row, col]` array) by `1`. *(e.g., `[4, 2]` becomes `[5, 2]`)*.
116
-
2.**In your `"rgb_matrix"` block:** If the keyboard has per-key RGB, you must do the exact same `+1` row shift for the `"layout"` array located inside `"rgb_matrix"` so the lighting correctly aligns with the shifted matrix!
117
-
118
137
## 6. Update your `keymap.c` or `keymap.json`
119
138
Because your layout macro now has a new name and expects 5 (or 10) more keys, compiling an old keymap will fail.
120
139
@@ -162,32 +181,14 @@ Update the entry to:
162
181
163
182
This ensures the CI system builds the firmware using the overlayed keyboard definition rather than the original keyboard from the main repository.
164
183
165
-
## 7. Compile
166
-
Because of the hacky way this overlay ties into the QMK build system, GitHub CI handles the file merging automatically, but local compilation requires an extra symlinking step.
184
+
## 8. Compile
185
+
After porting the keyboard you can compile it using the same userspace build process described in the main README.
167
186
168
-
### Option A: Build via GitHub CI (Recommended)
169
-
Simply commit and push your changes to your fork of the repository. The GitHub Actions workflow will automatically handle the hacky merges, compile the firmware, and upload the binaries in the **Releases** tab of your repository!
170
-
171
-
### Option B: Build Locally
187
+
### Build Locally
172
188
Because QMK doesn't natively support overlaying base `keyboard.json` files from an external userspace directory, you must symlink your customized keyboard folder into your local QMK/Vial tree so the compiler can find it.
173
189
174
190
1. Open your terminal and create a symlink from your userspace to your local QMK (or Vial) repository:
0 commit comments