@@ -93,193 +93,9 @@ enum { MACRO_VERSION_INFO,
93
93
};
94
94
95
95
96
+ // Keymaps are defined in a separate file
97
+ #include " keymaps.h"
96
98
97
- /* * The Model 01's key layouts are defined as 'keymaps'. By default, there are three
98
- * keymaps: The standard QWERTY keymap, the "Function layer" keymap and the "Numpad"
99
- * keymap.
100
- *
101
- * Each keymap is defined as a list using the 'KEYMAP_STACKED' macro, built
102
- * of first the left hand's layout, followed by the right hand's layout.
103
- *
104
- * Keymaps typically consist mostly of `Key_` definitions. There are many, many keys
105
- * defined as part of the USB HID Keyboard specification. You can find the names
106
- * (if not yet the explanations) for all the standard `Key_` defintions offered by
107
- * Kaleidoscope in these files:
108
- * https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_keyboard.h
109
- * https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_consumerctl.h
110
- * https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_sysctl.h
111
- * https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_keymaps.h
112
- *
113
- * Additional things that should be documented here include
114
- * using ___ to let keypresses fall through to the previously active layer
115
- * using XXX to mark a keyswitch as 'blocked' on this layer
116
- * using ShiftToLayer() and LockLayer() keys to change the active keymap.
117
- * keeping NUM and FN consistent and accessible on all layers
118
- *
119
- * The PROG key is special, since it is how you indicate to the board that you
120
- * want to flash the firmware. However, it can be remapped to a regular key.
121
- * When the keyboard boots, it first looks to see whether the PROG key is held
122
- * down; if it is, it simply awaits further flashing instructions. If it is
123
- * not, it continues loading the rest of the firmware and the keyboard
124
- * functions normally, with whatever binding you have set to PROG. More detail
125
- * here: https://community.keyboard.io/t/how-the-prog-key-gets-you-into-the-bootloader/506/8
126
- *
127
- * The "keymaps" data structure is a list of the keymaps compiled into the firmware.
128
- * The order of keymaps in the list is important, as the ShiftToLayer(#) and LockLayer(#)
129
- * macros switch to key layers based on this list.
130
- *
131
- *
132
-
133
- * A key defined as 'ShiftToLayer(FUNCTION)' will switch to FUNCTION while held.
134
- * Similarly, a key defined as 'LockLayer(NUMPAD)' will switch to NUMPAD when tapped.
135
- */
136
-
137
- /* *
138
- * Layers are "0-indexed" -- That is the first one is layer 0. The second one is layer 1.
139
- * The third one is layer 2.
140
- * This 'enum' lets us use names like QWERTY, FUNCTION, and NUMPAD in place of
141
- * the numbers 0, 1 and 2.
142
- *
143
- */
144
-
145
- enum { PRIMARY, NUMPAD, FUNCTION }; // layers
146
-
147
-
148
- /* *
149
- * To change your keyboard's layout from QWERTY to DVORAK or COLEMAK, comment out the line
150
- *
151
- * #define PRIMARY_KEYMAP_QWERTY
152
- *
153
- * by changing it to
154
- *
155
- * // #define PRIMARY_KEYMAP_QWERTY
156
- *
157
- * Then uncomment the line corresponding to the layout you want to use.
158
- *
159
- */
160
-
161
- #define PRIMARY_KEYMAP_QWERTY
162
- // #define PRIMARY_KEYMAP_COLEMAK
163
- // #define PRIMARY_KEYMAP_DVORAK
164
- // #define PRIMARY_KEYMAP_CUSTOM
165
-
166
-
167
-
168
- /* This comment temporarily turns off astyle's indent enforcement
169
- * so we can make the keymaps actually resemble the physical key layout better
170
- */
171
- // *INDENT-OFF*
172
-
173
- KEYMAPS (
174
-
175
- #if defined (PRIMARY_KEYMAP_QWERTY)
176
- [PRIMARY] = KEYMAP_STACKED
177
- (___, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext,
178
- Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab,
179
- Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G,
180
- Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape,
181
- Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
182
- ShiftToLayer (FUNCTION),
183
-
184
- M(MACRO_ANY), Key_6, Key_7, Key_8, Key_9, Key_0, LockLayer(NUMPAD),
185
- Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals,
186
- Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote,
187
- Key_RightAlt, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus,
188
- Key_RightShift, Key_LeftAlt, Key_Spacebar, Key_RightControl,
189
- ShiftToLayer(FUNCTION)),
190
-
191
- #elif defined (PRIMARY_KEYMAP_DVORAK)
192
-
193
- [PRIMARY] = KEYMAP_STACKED
194
- (___, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext,
195
- Key_Backtick, Key_Quote, Key_Comma, Key_Period, Key_P, Key_Y, Key_Tab,
196
- Key_PageUp, Key_A, Key_O, Key_E, Key_U, Key_I,
197
- Key_PageDown, Key_Semicolon, Key_Q, Key_J, Key_K, Key_X, Key_Escape,
198
- Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
199
- ShiftToLayer (FUNCTION),
200
-
201
- M(MACRO_ANY), Key_6, Key_7, Key_8, Key_9, Key_0, LockLayer(NUMPAD),
202
- Key_Enter, Key_F, Key_G, Key_C, Key_R, Key_L, Key_Slash,
203
- Key_D, Key_H, Key_T, Key_N, Key_S, Key_Minus,
204
- Key_RightAlt, Key_B, Key_M, Key_W, Key_V, Key_Z, Key_Equals,
205
- Key_RightShift, Key_LeftAlt, Key_Spacebar, Key_RightControl,
206
- ShiftToLayer(FUNCTION)),
207
-
208
- #elif defined (PRIMARY_KEYMAP_COLEMAK)
209
-
210
- [PRIMARY] = KEYMAP_STACKED
211
- (___, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext,
212
- Key_Backtick, Key_Q, Key_W, Key_F, Key_P, Key_G, Key_Tab,
213
- Key_PageUp, Key_A, Key_R, Key_S, Key_T, Key_D,
214
- Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape,
215
- Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
216
- ShiftToLayer (FUNCTION),
217
-
218
- M(MACRO_ANY), Key_6, Key_7, Key_8, Key_9, Key_0, LockLayer(NUMPAD),
219
- Key_Enter, Key_J, Key_L, Key_U, Key_Y, Key_Semicolon, Key_Equals,
220
- Key_H, Key_N, Key_E, Key_I, Key_O, Key_Quote,
221
- Key_RightAlt, Key_K, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus,
222
- Key_RightShift, Key_LeftAlt, Key_Spacebar, Key_RightControl,
223
- ShiftToLayer(FUNCTION)),
224
-
225
- #elif defined (PRIMARY_KEYMAP_CUSTOM)
226
- // Edit this keymap to make a custom layout
227
- [PRIMARY] = KEYMAP_STACKED
228
- (___, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext,
229
- Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab,
230
- Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G,
231
- Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape,
232
- Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
233
- ShiftToLayer (FUNCTION),
234
-
235
- M(MACRO_ANY), Key_6, Key_7, Key_8, Key_9, Key_0, LockLayer(NUMPAD),
236
- Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals,
237
- Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote,
238
- Key_RightAlt, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus,
239
- Key_RightShift, Key_LeftAlt, Key_Spacebar, Key_RightControl,
240
- ShiftToLayer(FUNCTION)),
241
-
242
- #else
243
-
244
- #error "No default keymap defined. You should make sure that you have a line like '#define PRIMARY_KEYMAP_QWERTY' in your sketch"
245
-
246
- #endif
247
-
248
-
249
-
250
- [NUMPAD] = KEYMAP_STACKED
251
- (___, ___, ___, ___, ___, ___, ___,
252
- ___, ___, ___, ___, ___, ___, ___,
253
- ___, ___, ___, ___, ___, ___,
254
- ___, ___, ___, ___, ___, ___, ___,
255
- ___, ___, ___, ___,
256
- ___,
257
-
258
- M (MACRO_VERSION_INFO), ___, Key_7, Key_8, Key_9, Key_KeypadSubtract, ___,
259
- ___, ___, Key_4, Key_5, Key_6, Key_KeypadAdd, ___,
260
- ___, Key_1, Key_2, Key_3, Key_Equals, ___,
261
- ___, ___, Key_0, Key_Period, Key_KeypadMultiply, Key_KeypadDivide, Key_Enter,
262
- ___, ___, ___, ___,
263
- ___),
264
-
265
- [FUNCTION] = KEYMAP_STACKED
266
- (___, Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, Key_CapsLock,
267
- Key_Tab, ___, Key_mouseUp, ___, Key_mouseBtnR, Key_mouseWarpEnd, Key_mouseWarpNE,
268
- Key_Home, Key_mouseL, Key_mouseDn, Key_mouseR, Key_mouseBtnL, Key_mouseWarpNW,
269
- Key_End, Key_PrintScreen, Key_Insert, ___, Key_mouseBtnM, Key_mouseWarpSW, Key_mouseWarpSE,
270
- ___, Key_Delete, ___, ___,
271
- ___,
272
-
273
- Consumer_ScanPreviousTrack, Key_F6, Key_F7, Key_F8, Key_F9, Key_F10, Key_F11,
274
- Consumer_PlaySlashPause, Consumer_ScanNextTrack, Key_LeftCurlyBracket, Key_RightCurlyBracket, Key_LeftBracket, Key_RightBracket, Key_F12,
275
- Key_LeftArrow, Key_DownArrow, Key_UpArrow, Key_RightArrow, ___, ___,
276
- Key_PcApplication, Consumer_Mute, Consumer_VolumeDecrement, Consumer_VolumeIncrement, ___, Key_Backslash, Key_Pipe,
277
- ___, ___, Key_Enter, ___,
278
- ___)
279
- ) // KEYMAPS(
280
-
281
- /* Re-enable astyle's indent enforcement */
282
- // *INDENT-ON*
283
99
284
100
/* * versionInfoMacro handles the 'firmware version info' macro
285
101
* When a key bound to the macro is pressed, this macro
0 commit comments