From 171d82f16e7f3c505becf1cf6d299d2205596114 Mon Sep 17 00:00:00 2001 From: Andrew Gallagher Date: Wed, 25 Oct 2017 14:28:34 +0100 Subject: [PATCH] Created keymaps marshalling file --- keymaps.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 keymaps.h diff --git a/keymaps.h b/keymaps.h new file mode 100644 index 00000000..6d8a328d --- /dev/null +++ b/keymaps.h @@ -0,0 +1,54 @@ +/** The Model 01's key layouts are defined as 'keymaps'. By default, there are three + * keymaps: The standard QWERTY keymap, the "Function layer" keymap and the "Numpad" + * keymap. + * + * Each keymap is defined as a list using the 'KEYMAP_STACKED' macro, built + * of first the left hand's layout, followed by the right hand's layout. + * + * Keymaps typically consist mostly of `Key_` definitions. There are many, many keys + * defined as part of the USB HID Keyboard specification. You can find the names + * (if not yet the explanations) for all the standard `Key_` defintions offered by + * Kaleidoscope in these files: + * https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keyboard.h + * https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_consumerctl.h + * https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_sysctl.h + * https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keymaps.h + * + * Additional things that should be documented here include + * using ___ to let keypresses fall through to the previously active layer + * using XXX to mark a keyswitch as 'blocked' on this layer + * using ShiftToLayer() and LockLayer() keys to change the active keymap. + * the special nature of the PROG key + * keeping NUM and FN consistent and accessible on all layers + * + * + * The "keymaps" data structure is a list of the keymaps compiled into the firmware. + * The order of keymaps in the list is important, as the ShiftToLayer(#) and LockLayer(#) + * macros switch to key layers based on this list. + * + * + + * A key defined as 'ShiftToLayer(FUNCTION)' will switch to FUNCTION while held. + * Similarly, a key defined as 'LockLayer(NUMPAD)' will switch to NUMPAD when tapped. + */ + +/** + * Layers are "0-indexed" -- That is the first one is layer 0. The second one is layer 1. + * The third one is layer 2. + * This 'enum' lets us use names like QWERTY, FUNCTION, and NUMPAD in place of + * the numbers 0, 1 and 2. + */ + +enum { QWERTY, FUNCTION, NUMPAD }; // layers + +const Key keymaps[][ROWS][COLS] PROGMEM = { + [QWERTY] = + #include "layer-std-qwerty.h" + , + [FUNCTION] = + #include "layer-std-function.h" + , + [NUMPAD] = + #include "layer-std-numpad.h" +}; +