Skip to content

Commit 92b9646

Browse files
committed
Rewrote on top of latest upstream HEAD
1 parent 5c77a37 commit 92b9646

File tree

3 files changed

+194
-190
lines changed

3 files changed

+194
-190
lines changed

Model01-Firmware.ino

Lines changed: 2 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -90,193 +90,11 @@ enum { MACRO_VERSION_INFO,
9090
};
9191

9292

93-
94-
/** The Model 01's key layouts are defined as 'keymaps'. By default, there are three
95-
* keymaps: The standard QWERTY keymap, the "Function layer" keymap and the "Numpad"
96-
* keymap.
97-
*
98-
* Each keymap is defined as a list using the 'KEYMAP_STACKED' macro, built
99-
* of first the left hand's layout, followed by the right hand's layout.
100-
*
101-
* Keymaps typically consist mostly of `Key_` definitions. There are many, many keys
102-
* defined as part of the USB HID Keyboard specification. You can find the names
103-
* (if not yet the explanations) for all the standard `Key_` defintions offered by
104-
* Kaleidoscope in these files:
105-
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keyboard.h
106-
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_consumerctl.h
107-
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_sysctl.h
108-
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keymaps.h
109-
*
110-
* Additional things that should be documented here include
111-
* using ___ to let keypresses fall through to the previously active layer
112-
* using XXX to mark a keyswitch as 'blocked' on this layer
113-
* using ShiftToLayer() and LockLayer() keys to change the active keymap.
114-
* keeping NUM and FN consistent and accessible on all layers
115-
*
116-
* The PROG key is special, since it is how you indicate to the board that you
117-
* want to flash the firmware. However, it can be remapped to a regular key.
118-
* When the keyboard boots, it first looks to see whether the PROG key is held
119-
* down; if it is, it simply awaits further flashing instructions. If it is
120-
* not, it continues loading the rest of the firmware and the keyboard
121-
* functions normally, with whatever binding you have set to PROG. More detail
122-
* here: https://community.keyboard.io/t/how-the-prog-key-gets-you-into-the-bootloader/506/8
123-
*
124-
* The "keymaps" data structure is a list of the keymaps compiled into the firmware.
125-
* The order of keymaps in the list is important, as the ShiftToLayer(#) and LockLayer(#)
126-
* macros switch to key layers based on this list.
127-
*
128-
*
129-
130-
* A key defined as 'ShiftToLayer(FUNCTION)' will switch to FUNCTION while held.
131-
* Similarly, a key defined as 'LockLayer(NUMPAD)' will switch to NUMPAD when tapped.
132-
*/
133-
13493
/**
135-
* Layers are "0-indexed" -- That is the first one is layer 0. The second one is layer 1.
136-
* The third one is layer 2.
137-
* This 'enum' lets us use names like QWERTY, FUNCTION, and NUMPAD in place of
138-
* the numbers 0, 1 and 2.
139-
*
94+
* Keymaps are defined in a separate file
14095
*/
96+
#include "keymaps.h"
14197

142-
enum { PRIMARY, NUMPAD, FUNCTION }; // layers
143-
144-
145-
/**
146-
* To change your keyboard's layout from QWERTY to DVORAK or COLEMAK, comment out the line
147-
*
148-
* #define PRIMARY_KEYMAP_QWERTY
149-
*
150-
* by changing it to
151-
*
152-
* // #define PRIMARY_KEYMAP_QWERTY
153-
*
154-
* Then uncomment the line corresponding to the layout you want to use.
155-
*
156-
*/
157-
158-
#define PRIMARY_KEYMAP_QWERTY
159-
// #define PRIMARY_KEYMAP_COLEMAK
160-
// #define PRIMARY_KEYMAP_DVORAK
161-
// #define PRIMARY_KEYMAP_CUSTOM
162-
163-
164-
165-
/* This comment temporarily turns off astyle's indent enforcement
166-
* so we can make the keymaps actually resemble the physical key layout better
167-
*/
168-
// *INDENT-OFF*
169-
170-
KEYMAPS(
171-
172-
#if defined (PRIMARY_KEYMAP_QWERTY)
173-
[PRIMARY] = KEYMAP_STACKED
174-
(___, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext,
175-
Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab,
176-
Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G,
177-
Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape,
178-
Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
179-
ShiftToLayer(FUNCTION),
180-
181-
M(MACRO_ANY), Key_6, Key_7, Key_8, Key_9, Key_0, LockLayer(NUMPAD),
182-
Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals,
183-
Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote,
184-
Key_RightAlt, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus,
185-
Key_RightShift, Key_LeftAlt, Key_Spacebar, Key_RightControl,
186-
ShiftToLayer(FUNCTION)),
187-
188-
#elif defined (PRIMARY_KEYMAP_DVORAK)
189-
190-
[PRIMARY] = KEYMAP_STACKED
191-
(___, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext,
192-
Key_Backtick, Key_Quote, Key_Comma, Key_Period, Key_P, Key_Y, Key_Tab,
193-
Key_PageUp, Key_A, Key_O, Key_E, Key_U, Key_I,
194-
Key_PageDown, Key_Semicolon, Key_Q, Key_J, Key_K, Key_X, Key_Escape,
195-
Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
196-
ShiftToLayer(FUNCTION),
197-
198-
M(MACRO_ANY), Key_6, Key_7, Key_8, Key_9, Key_0, LockLayer(NUMPAD),
199-
Key_Enter, Key_F, Key_G, Key_C, Key_R, Key_L, Key_Slash,
200-
Key_D, Key_H, Key_T, Key_N, Key_S, Key_Minus,
201-
Key_RightAlt, Key_B, Key_M, Key_W, Key_V, Key_Z, Key_Equals,
202-
Key_RightShift, Key_LeftAlt, Key_Spacebar, Key_RightControl,
203-
ShiftToLayer(FUNCTION)),
204-
205-
#elif defined (PRIMARY_KEYMAP_COLEMAK)
206-
207-
[PRIMARY] = KEYMAP_STACKED
208-
(___, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext,
209-
Key_Backtick, Key_Q, Key_W, Key_F, Key_P, Key_G, Key_Tab,
210-
Key_PageUp, Key_A, Key_R, Key_S, Key_T, Key_D,
211-
Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape,
212-
Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
213-
ShiftToLayer(FUNCTION),
214-
215-
M(MACRO_ANY), Key_6, Key_7, Key_8, Key_9, Key_0, LockLayer(NUMPAD),
216-
Key_Enter, Key_J, Key_L, Key_U, Key_Y, Key_Semicolon, Key_Equals,
217-
Key_H, Key_N, Key_E, Key_I, Key_O, Key_Quote,
218-
Key_RightAlt, Key_K, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus,
219-
Key_RightShift, Key_LeftAlt, Key_Spacebar, Key_RightControl,
220-
ShiftToLayer(FUNCTION)),
221-
222-
#elif defined (PRIMARY_KEYMAP_CUSTOM)
223-
// Edit this keymap to make a custom layout
224-
[PRIMARY] = KEYMAP_STACKED
225-
(___, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext,
226-
Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab,
227-
Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G,
228-
Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape,
229-
Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
230-
ShiftToLayer(FUNCTION),
231-
232-
M(MACRO_ANY), Key_6, Key_7, Key_8, Key_9, Key_0, LockLayer(NUMPAD),
233-
Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals,
234-
Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote,
235-
Key_RightAlt, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus,
236-
Key_RightShift, Key_LeftAlt, Key_Spacebar, Key_RightControl,
237-
ShiftToLayer(FUNCTION)),
238-
239-
#else
240-
241-
#error "No default keymap defined. You should make sure that you have a line like '#define PRIMARY_KEYMAP_QWERTY' in your sketch"
242-
243-
#endif
244-
245-
246-
247-
[NUMPAD] = KEYMAP_STACKED
248-
(___, ___, ___, ___, ___, ___, ___,
249-
___, ___, ___, ___, ___, ___, ___,
250-
___, ___, ___, ___, ___, ___,
251-
___, ___, ___, ___, ___, ___, ___,
252-
___, ___, ___, ___,
253-
___,
254-
255-
M(MACRO_VERSION_INFO), ___, Key_7, Key_8, Key_9, Key_KeypadSubtract, ___,
256-
___, ___, Key_4, Key_5, Key_6, Key_KeypadAdd, ___,
257-
___, Key_1, Key_2, Key_3, Key_Equals, ___,
258-
___, ___, Key_0, Key_Period, Key_KeypadMultiply, Key_KeypadDivide, Key_Enter,
259-
___, ___, ___, ___,
260-
___),
261-
262-
[FUNCTION] = KEYMAP_STACKED
263-
(___, Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, Key_CapsLock,
264-
Key_Tab, ___, Key_mouseUp, ___, Key_mouseBtnR, Key_mouseWarpEnd, Key_mouseWarpNE,
265-
Key_Home, Key_mouseL, Key_mouseDn, Key_mouseR, Key_mouseBtnL, Key_mouseWarpNW,
266-
Key_End, Key_PrintScreen, Key_Insert, ___, Key_mouseBtnM, Key_mouseWarpSW, Key_mouseWarpSE,
267-
___, Key_Delete, ___, ___,
268-
___,
269-
270-
Consumer_ScanPreviousTrack, Key_F6, Key_F7, Key_F8, Key_F9, Key_F10, Key_F11,
271-
Consumer_PlaySlashPause, Consumer_ScanNextTrack, Key_LeftCurlyBracket, Key_RightCurlyBracket, Key_LeftBracket, Key_RightBracket, Key_F12,
272-
Key_LeftArrow, Key_DownArrow, Key_UpArrow, Key_RightArrow, ___, ___,
273-
Key_PcApplication, Consumer_Mute, Consumer_VolumeDecrement, Consumer_VolumeIncrement, ___, Key_Backslash, Key_Pipe,
274-
___, ___, Key_Enter, ___,
275-
___)
276-
) // KEYMAPS(
277-
278-
/* Re-enable astyle's indent enforcement */
279-
// *INDENT-ON*
28098

28199
/** versionInfoMacro handles the 'firmware version info' macro
282100
* When a key bound to the macro is pressed, this macro

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ _The default firmware for the Keyboardio Model 01_
44

55
<h3>This is a quick start guide for folks who are familiar with Arduino and prefer to use the command line. For everyone else:
66

7-
* [Check out the wiki](https://github.com/keyboardio/Kaleidoscope/wiki/Keyboardio-Model-01-Introduction) for a more in depth introduction to how the Model 01 keyboard and the Kaleidoscope firmware work.
8-
7+
* [Check out the wiki](https://github.com/keyboardio/Kaleidoscope/wiki/Keyboardio-Model-01-Introduction) for a more in depth introduction to how the Model 01 keyboard and the Kaleidoscope firmware work.
8+
99
* If you have questions, [The community forums are happy to help!](https://community.keyboard.io/)</h3>
1010

1111
# Download and install
@@ -30,17 +30,17 @@ If you install Arduino into some place that's /not/ `/usr/local/arduino`, you'll
3030
### MacOS
3131
```sh
3232
mkdir -p $HOME/Documents/Arduino
33-
cd $HOME/Documents/Arduino
33+
cd $HOME/Documents/Arduino
3434
```
3535

3636
### Linux
3737

3838
```sh
3939
mkdir -p $HOME/Arduino
40-
cd $HOME/Arduino
40+
cd $HOME/Arduino
4141
```
4242

43-
## Download hardware platform, including library source code
43+
## Download hardware platform, including library source code
4444

4545
```sh
4646
mkdir -p hardware
@@ -81,7 +81,7 @@ Hold down the "Prog" key in the top left corner of your keyboard, until the comp
8181

8282
# Start to customize the firmware
8383

84-
You can customize your keyboard's key layout and LED effects by modifying the `Model01-Firmware.ino` file in the same directory as this README. Model01-Firmware.ino is a computer program written in 'Arduino C'. You can find documentation about Arduino C at https://arduino.cc.
84+
You can customize your keyboard's behaviour by modifying the `Model01-Firmware.ino` file in the same directory as this README. Model01-Firmware.ino is a computer program written in 'Arduino C'. You can find documentation about Arduino C at https://arduino.cc. The keyboard layout is defined in the include file `keymaps.h`, which consists mainly of C preprocessor macros.
8585
8686
8787
# Updating the firmware and libraries

0 commit comments

Comments
 (0)