aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Height <brandon.height@bodybuilding.com>2017-06-19 20:12:30 -0700
committerBrandon Height <brandon.height@bodybuilding.com>2017-06-19 20:12:30 -0700
commit2ffcf47793f825d510077975cc72ed0f1f7fd036 (patch)
tree3f67c7a1a060499234ce129ec3fc4cf0fbfe1719
parent3e7bb196124aeab8c84752501b7ec91915814735 (diff)
downloadqmk_firmware-2ffcf47793f825d510077975cc72ed0f1f7fd036.tar.gz
qmk_firmware-2ffcf47793f825d510077975cc72ed0f1f7fd036.zip
This is a complete redo of my keymap. It includes several
layers including qwerty, colemak, navigation, and gui layers. I also was playing around with dancing tap keys.
-rw-r--r--keyboards/planck/keymaps/brandon/Makefile32
-rw-r--r--keyboards/planck/keymaps/brandon/config.h98
-rw-r--r--keyboards/planck/keymaps/brandon/keymap.c512
3 files changed, 499 insertions, 143 deletions
diff --git a/keyboards/planck/keymaps/brandon/Makefile b/keyboards/planck/keymaps/brandon/Makefile
index cf2c31f0f..a79bda373 100644
--- a/keyboards/planck/keymaps/brandon/Makefile
+++ b/keyboards/planck/keymaps/brandon/Makefile
@@ -1,27 +1,13 @@
1# Please remove if no longer applicable 1# This gets included at the beginning of the Planck's Makefile.
2$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) 2# Alternatively, you can run make from the keymap directory
3$(warning Please disable some options in the Makefile to resolve) 3# and the main Makefile will be included after.
4 4
5# Build Options 5COMMAND_ENABLE = no # Disable shift combination, which conflicts with shift-parens
6# change to "no" to disable the options, or define them in the Makefile in 6NKRO_ENABLE = yes # N-key rollover required for use as a steno board
7# the appropriate keymap folder that will get included automatically 7AUDIO_ENABLE = no # Audio output on port C6
8# 8TAP_DANCE_ENABLE = yes
9BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) 9MOUSEKEY_ENABLE = yes
10MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
11EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
12CONSOLE_ENABLE = no # Console for debug(+400)
13COMMAND_ENABLE = yes # Commands for debug and configuration
14NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
15BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
16MIDI_ENABLE = no # MIDI controls
17AUDIO_ENABLE = yes # Audio output on port C6
18UNICODE_ENABLE = no # Unicode
19BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
20RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
21
22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24 10
25ifndef QUANTUM_DIR 11ifndef QUANTUM_DIR
26 include ../../../../Makefile 12 include ../../../../Makefile
27endif \ No newline at end of file 13endif
diff --git a/keyboards/planck/keymaps/brandon/config.h b/keyboards/planck/keymaps/brandon/config.h
new file mode 100644
index 000000000..5442ebf75
--- /dev/null
+++ b/keyboards/planck/keymaps/brandon/config.h
@@ -0,0 +1,98 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#define TAPPING_TERM 200
22
23#include "config_common.h"
24
25/* USB Device descriptor parameter */
26#define VENDOR_ID 0xFEED
27#define PRODUCT_ID 0x6060
28#define MANUFACTURER Ortholinear Keyboards
29#define PRODUCT The Planck Keyboard
30#define DESCRIPTION A compact ortholinear keyboard
31
32/* key matrix size */
33#define MATRIX_ROWS 4
34#define MATRIX_COLS 12
35
36/* Planck PCB default pin-out */
37#define MATRIX_ROW_PINS { D0, D5, B5, B6 }
38#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
39#define UNUSED_PINS
40
41#define AUDIO_VOICES
42
43#define BACKLIGHT_PIN B7
44
45/* COL2ROW or ROW2COL */
46#define DIODE_DIRECTION COL2ROW
47
48/* define if matrix has ghost */
49//#define MATRIX_HAS_GHOST
50
51/* number of backlight levels */
52#define BACKLIGHT_LEVELS 3
53
54/* Set 0 if debouncing isn't needed */
55#define DEBOUNCING_DELAY 5
56
57/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
58#define LOCKING_SUPPORT_ENABLE
59/* Locking resynchronize hack */
60#define LOCKING_RESYNC_ENABLE
61
62/* key combination for command */
63#define IS_COMMAND() ( \
64 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
65)
66
67#define MOUSEKEY_INTERVAL 20
68#define MOUSEKEY_DELAY 0
69#define MOUSEKEY_TIME_TO_MAX 60
70#define MOUSEKEY_MAX_SPEED 7
71#define MOUSEKEY_WHEEL_DELAY 0
72
73/*
74 * Feature disable options
75 * These options are also useful to firmware size reduction.
76 */
77
78/* disable debug print */
79//#define NO_DEBUG
80
81/* disable print */
82//#define NO_PRINT
83
84/* disable action features */
85//#define NO_ACTION_LAYER
86//#define NO_ACTION_TAPPING
87//#define NO_ACTION_ONESHOT
88//#define NO_ACTION_MACRO
89//#define NO_ACTION_FUNCTION
90
91#ifdef SUBPROJECT_rev3
92 #include "rev3/config.h"
93#endif
94#ifdef SUBPROJECT_rev4
95 #include "rev4/config.h"
96#endif
97
98#endif
diff --git a/keyboards/planck/keymaps/brandon/keymap.c b/keyboards/planck/keymaps/brandon/keymap.c
index 2b89f86db..f6ee89b17 100644
--- a/keyboards/planck/keymaps/brandon/keymap.c
+++ b/keyboards/planck/keymaps/brandon/keymap.c
@@ -1,134 +1,406 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "planck.h" 1#include "planck.h"
5#ifdef BACKLIGHT_ENABLE 2#include "action_layer.h"
6 #include "backlight.h" 3#include "eeconfig.h"
7#endif 4#include "keymap_plover.h"
5#include "action_tapping.h"
6
7extern keymap_config_t keymap_config;
8
9// Keymap layers
10enum planck_layers {
11 BASE_QWERTY_LAYER,
12 BASE_COLEMAK_LAYER,
13 BASE_STENO_LAYER,
14 LOWER_LAYER,
15 RAISE_LAYER,
16 NAVIGATION_LAYER,
17 GUI_LAYER,
18 KEYBOARD_LAYER
19};
20
21// Key aliases for legibility
22#define _______ KC_TRNS
23#define ___x___ KC_NO
24
25// Macros
26enum planck_macros {
27 LALT_BRACE,
28 RALT_BRACE
29};
30
31// Dashes (macOS)
32#define KC_NDSH LALT(KC_MINS)
33#define KC_MDSH S(LALT(KC_MINS))
8 34
9// Each layer gets a name for readability, which is then used in the keymap matrix below. 35// Window manager keys
10// The underscores don't mean anything - you can have a layer called STUFF or any other name. 36#define WM_FULL LALT(LGUI(KC_F))
11// Layer names don't all need to be of the same length, obviously, and you can also skip them 37#define WM_NEXT LCTL(LALT(LGUI(KC_RGHT)))
12// entirely and just use numbers. 38#define WM_PREV LCTL(LALT(LGUI(KC_LEFT)))
13#define _QW 0 39#define WM_NW LCTL(LGUI(KC_LEFT))
14#define _CM 1 40#define WM_N LALT(LGUI(KC_UP))
15#define _TK 2 41#define WM_NE LCTL(LGUI(KC_RGHT))
16#define _LW 3 42#define WM_E LALT(LGUI(KC_RGHT))
17#define _RS 4 43#define WM_SE S(LCTL(LGUI(KC_RGHT)))
44#define WM_S LALT(LGUI(KC_DOWN))
45#define WM_SW S(LCTL(LGUI(KC_LEFT)))
46#define WM_W LALT(LGUI(KC_LEFT))
47#define WM_CNTR LALT(LGUI(KC_C))
48
49// Special key codes
50enum planck_keycodes {
51 QWERTY = SAFE_RANGE,
52 COLEMAK,
53 STENO,
54 LOWER,
55 RAISE,
56 PV_EXIT,
57 PV_LOOK
58};
59
60//Tap Dance Declarations
61enum {
62 TD_ESC_GRV = 0
63};
64
65// Tap Dance Definitions
66qk_tap_dance_action_t tap_dance_actions[] = {
67 // Tap once for Esc, twice for Backspace
68 [TD_ESC_GRV] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV)
69 // Other declarations would go here, separated by commas, if you have them
70};
18 71
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 72const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20[_QW] = { /* Qwerty */ 73 /* Base layer (Qwerty)
21/* MIT Layout (QWERTY layer) 74 * ,-----------------------------------------------------------------------.
22 * 75 * Double tap 4 ~ | ESC | Q | W | E | R | T | Y | U | I | O | P | ' |
23 * ,-----------------------------------------------------------------------. 76 * |-----------------------------------------------------------------------|
24 * | esc | q | w | e | r | t | y | u | i | o | p | bspc| 77 * Tap for Tab -- |Ctrl | A | S | D | F | G | H | J | K | L |; Fn4|Ctrl | -- Tap for Enter
25 * |-----------------------------------------------------------------------| 78 * |-----------------------------------------------------------------------|
26 * | tab | a | s | d | f | g | h | j | k | l | ; | ' | 79 * Tap for ( -- |Shift| Z | X | C | V | B | N | M | , | . | / |Shift| -- Tap for )
27 * |-----------------------------------------------------------------------| 80 * |-----------------------------------------------------------------------|
28 * |shift| z | x | c | v | b | n | m | , | . | / |enter| 81 * Tap for [ -- | Fn3 |Hyper| Alt |Super| Fn1 | Space | Fn2 |Super| Alt |Hyper| Fn3 | -- Tap for ]
29 * |-----------------------------------------------------------------------| 82 * `-----------------------------------------------------------------------'
30 * | ctl | alt | win | TK |lower| spc |raise|left |down | up |right| 83 * / /
31 * `-----------------------------------------------------------------------' 84 * Tap for ] [ --------'-----------------------------------------------------'
32 */ 85 */
33 {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, 86 [BASE_QWERTY_LAYER] = {
34 {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, 87 {TD(TD_ESC_GRV), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT},
35 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_LSFT, KC_ENT) }, 88 {F(5), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, F(1), F(6)},
36 {KC_LCTL, KC_LALT, KC_LGUI, TG(_TK), MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} 89 {KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC},
37}, 90 {F(3), ALL_T(KC_RBRC), M(LALT_BRACE), KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_RGUI, M(RALT_BRACE), ALL_T(KC_LBRC), F(4)}
38[_CM] = { /* Colemak */ 91 },
39/* MIT Layout (Colemak layer) 92
40 * 93 /* Base layer (Colemak)
41 * ,-----------------------------------------------------------------------. 94 * ,-----------------------------------------------------------------------.
42 * | esc | q | w | f | p | g | j | l | u | y | ; | bspc| 95 * | | Q | W | F | P | G | J | L | U | Y | ; | |
43 * |-----------------------------------------------------------------------| 96 * |-----------------------------------------------------------------------|
44 * | tab | a | r | s | t | d | h | n | e | i | o | ' | 97 * | | A | R | S | T | D | H | N | E | I |O Fn4| |
45 * |-----------------------------------------------------------------------| 98 * |-----------------------------------------------------------------------|
46 * |shift| z | x | c | v | b | k | m | , | . | / |enter| 99 * | | Z | X | C | V | B | K | M | | | | |
47 * |-----------------------------------------------------------------------| 100 * |-----------------------------------------------------------------------|
48 * | ctl | alt | win | TK |lower| spc |raise|left |down | up |right| 101 * | | | | | | | | | | | |
49 * `-----------------------------------------------------------------------' 102 * `-----------------------------------------------------------------------'
50 */ 103 */
51 {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, 104 [BASE_COLEMAK_LAYER] = {
52 {KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, 105 {_______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______},
53 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_LSFT, KC_ENT)}, 106 {_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, F(2), _______},
54 {KC_LCTL, KC_LALT, KC_LGUI, TG(_TK), MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} 107 {_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, _______, _______, _______, _______},
55}, 108 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
56[_RS] = { /* RAISE */ 109 },
57/* MIT Layout (RAISE layer) 110
58 * 111 /* Base layer (Qwerty-Steno)
59 * ,-----------------------------------------------------------------------. 112 * ,-----------------------------------------------------------------------.
60 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | bspc| 113 * | # | # | # | # | # | # | # | # | # | # | # | # |
61 * |-----------------------------------------------------------------------| 114 * |-----------------------------------------------------------------------|
62 * | tab | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | 115 * |Look | | T | P | H | | F | P | L | T | D |
63 * |-----------------------------------------------------------------------| 116 * | -up | S |-----+-----+-----| * |-----+-----+-----+-----+-----|
64 * |shift| F7 | F8 | F9 | F10 | F11 | F12 | QW | CM | BL | RST |enter| 117 * | | | K | W | R | | R | B | G | S | Z |
65 * |-----------------------------------------------------------------------| 118 * |-----------------------------------------------------------------------|
66 * | ctl | alt | win | del |lower| spc |raise|next |vold |volu |PLAY | 119 * |Exit | | | A | O | | E | U | | | |
67 * `-----------------------------------------------------------------------' 120 * `-----------------------------------------------------------------------'
68 */ 121 */
69 122 [BASE_STENO_LAYER] = {
70 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, 123 {PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM},
71 {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, 124 {PV_LOOK, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD},
72 {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), M(0), RESET, KC_TRNS}, 125 {PV_LOOK, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ},
73 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} 126 {PV_EXIT, ___x___, ___x___, PV_A, PV_O, _______, _______, PV_E, PV_U, ___x___, ___x___, ___x___}
74}, 127 },
75[_LW] = { /* LOWER */ 128
76/* MIT Layout (Colemak layer) 129 /* Numeric layer
77 * 130 * ,-----------------------------------------------------------------------.
78 * ,-----------------------------------------------------------------------. 131 * Application -- |D-Grv| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | # |
79 * | esc | q | w | f | p | g | j | l | u | y | ; | bspc| 132 * window |-----------------------------------------------------------------------|
80 * |-----------------------------------------------------------------------| 133 * switcher | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
81 * | tab | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | 134 * |-----------------------------------------------------------------------|
82 * |-----------------------------------------------------------------------| 135 * | | - | = | ` | \ | |ndash|mdash| , | . | / | |
83 * |shift| F7 | F8 | F9 | F10 | F11 | F12 | QW | CM | BL | RST |enter| 136 * |-----------------------------------------------------------------------|
84 * |-----------------------------------------------------------------------| 137 * | | | | | | Backspace | | | | | |
85 * | ctl | alt | win | TK |lower| spc |raise|next |vold |volu |PLAY | 138 * `-----------------------------------------------------------------------'
86 * `-----------------------------------------------------------------------' 139 */
87 */ 140 [LOWER_LAYER] = {
88 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, 141 {LGUI(KC_GRV), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, S(KC_3)},
89 {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, 142 {F(5), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, F(6)},
90 {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), M(0), RESET, KC_TRNS}, 143 {KC_LSPO, KC_MINS, KC_EQL, KC_GRV, KC_BSLS, ___x___, KC_NDSH, KC_MDSH, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC},
91 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} 144 {F(3), ALL_T(KC_LBRC), M(LALT_BRACE), KC_LGUI, LOWER, KC_BSPC, KC_BSPC, RAISE, KC_RGUI, M(RALT_BRACE), ALL_T(KC_RBRC), F(4)}
92}, 145 },
93[_TK] = { /* Ten Key*/ 146
94/* MIT Layout (Ten Key layer) 147 /* Symbol layer
95 * 148 * ,-----------------------------------------------------------------------.
96 * ,-----------------------------------------------------------------------. 149 * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | # |
97 * | esc | F9 | F10 | F11 | F12 | PGUP| % | / | 7 | 8 | 9 | bspc| 150 * |-----------------------------------------------------------------------|
98 * |-----------------------------------------------------------------------| 151 * | | ! | @ | # | $ | % | ^ | & | * | ' | " | | \
99 * | tab | F5 | F6 | F7 | F8 | PGDN| HOME| * | 4 | 5 | 6 | \ | 152 * |-----------------------------------------------------------------------| |-- Mostly shifted version
100 * |-----------------------------------------------------------------------| 153 * | | _ | + | ~ | | | |ndash|mdash| , | . | / | | / of lower layer
101 * |shift| F1 | F2 | F3 | F4 | DEL | END | 0 | 1 | 2 | 3 |enter| 154 * |-----------------------------------------------------------------------|
102 * |-----------------------------------------------------------------------| 155 * | | | | | | Delete | | | | | |
103 * | ctl | alt | win | TK |lower| spc |raise|left |down | up |right| 156 * `-----------------------------------------------------------------------'
104 * `-----------------------------------------------------------------------' 157 */
105 */ 158 [RAISE_LAYER] = {
106 {KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGUP, KC_PERC, KC_SLSH, KC_7, KC_8, KC_9, KC_BSPC}, 159 {_______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, S(KC_3)},
107 {KC_TRNS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PGDN, KC_HOME, KC_ASTR, KC_4, KC_5, KC_6, KC_PIPE}, 160 {_______, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), KC_QUOT, S(KC_QUOT), _______},
108 {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_DEL, KC_END, KC_0, KC_1, KC_2, KC_3, KC_TRNS}, 161 {_______, KC_UNDS, KC_PLUS, KC_TILD, KC_PIPE, ___x___, KC_NDSH, KC_MDSH, KC_COMM, KC_DOT, KC_SLSH, _______},
109 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} 162 {_______, _______, _______, _______, _______, KC_DEL, KC_DEL, _______, _______, _______, _______, _______}
110} 163 },
164
165 /* Directional navigation layer
166 *
167 * Large movements -----/```````````````````\ /```````````````````\----- Vim-style arrow keys
168 * ,-----------------------------------------------------------------------.
169 * | | | | | | | | | | | | |
170 * |-----------------------------------------------------------------------|
171 * | | |Home |PgUp |PgDn | End |Left |Down | Up |Right| | |
172 * |-----------------------------------------------------------------------|
173 * | | | | | | | | | | | | |
174 * |-----------------------------------------------------------------------|
175 * | | | | | | | | | | | |
176 * `-----------------------------------------------------------------------'
177 */
178 [NAVIGATION_LAYER] = {
179 {___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___},
180 {_______, ___x___, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, F(1), _______},
181 {_______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, _______},
182 {_______, _______, _______, _______, ___x___, ___x___, ___x___, ___x___, _______, _______, _______, _______}
183 },
111 184
185 /* GUI (window management/mouse/media controls) layer
186 *
187 * Mouse keys -----/```````````````````\ /```````````````````\----- Window manager
188 * ,-----------------------------------------------------------------------.
189 * | |Ms B2|Ms Up|Ms B1|Ms WD| | |Prev | NW | N | NE | |
190 * |-----------------------------------------------------------------------|
191 * | |Ms L |Ms Dn|Ms R |Ms WU| | |Full | W |Centr| E | |
192 * |-----------------------------------------------------------------------|
193 * | |Ms WL|Ms B3|Ms WR| | | |Next | SW | S | SE | |
194 * |-----------------------------------------------------------------------|
195 * | |Prev |Play |Next |Brig-| Sleep |Brig+|Mute |Vol- |Vol+ | |
196 * `-----------------------------------------------------------------------'
197 * \___ Media ___/ \___ Screen/sleep __/ \___ Volume __/
198 */
199 [GUI_LAYER] = {
200 {_______, KC_BTN2, KC_MS_U, KC_BTN1, KC_WH_D, ___x___, ___x___, WM_PREV, WM_NW, WM_N, WM_NE, _______},
201 {_______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, ___x___, ___x___, WM_FULL, WM_W, WM_CNTR, WM_E, _______},
202 {_______, KC_WH_L, KC_BTN3, KC_WH_R, ___x___, ___x___, ___x___, WM_NEXT, WM_SW, WM_S, WM_SE, _______},
203 {_______, KC_MPRV, KC_MPLY, KC_MNXT, KC_SLCK, KC_SLEP, KC_SLEP, KC_PAUS, KC_MUTE, KC_VOLD, KC_VOLU, _______}
204 },
205
206 /* Keyboard settings layer
207 * ,-----------------------------------------------------------------------.
208 * Firmware -- | |Reset| | | | | | | | | | |
209 * |-----------------------------------------------------------------------|
210 * Set layer -- | |Qwert|Colem|Steno| ... | | | | | | | |
211 * |-----------------------------------------------------------------------|
212 * Audio -- | |Voic-|Voic+|Mus +|Mus -|MIDI+|MIDI-| | |Aud +|Aud -| |
213 * |-----------------------------------------------------------------------|
214 * | | | | | | Toggle | |Toggl| BL- | BL+ | |
215 * `-----------------------------------------------------------------------'
216 * \_____________\_ Backlight _/
217 */
218 [KEYBOARD_LAYER] = {
219 {___x___, RESET, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___},
220 {___x___, QWERTY, COLEMAK, STENO, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___},
221 {___x___, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, ___x___, ___x___, AU_ON, AU_OFF, ___x___},
222 {___x___, ___x___, ___x___, ___x___, LOWER, BL_TOGG, BL_TOGG, RAISE, BL_TOGG, BL_DEC, BL_INC, ___x___}
223 }
112}; 224};
113 225
114const uint16_t PROGMEM fn_actions[] = { 226const uint16_t PROGMEM fn_actions[] = {
227 // Layer switching
228 [1] = ACTION_LAYER_TAP_KEY(NAVIGATION_LAYER, KC_SCOLON),
229 [2] = ACTION_LAYER_TAP_KEY(NAVIGATION_LAYER, KC_O),
230 [3] = ACTION_LAYER_TAP_KEY(GUI_LAYER, KC_LBRACKET),
231 [4] = ACTION_LAYER_TAP_KEY(GUI_LAYER, KC_RBRACKET),
115 232
233 // Modifiers
234 [5] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_TAB),
235 [6] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT),
116}; 236};
117 237
118const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 238const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
119{ 239{
120 // MACRODOWN only works in this function 240 switch(id) {
121 switch(id) { 241 case LALT_BRACE:
122 case 0: 242 if (record->event.pressed) {
123 if (record->event.pressed) { 243 register_mods(MOD_LALT);
124 register_code(KC_RSFT); 244 record->tap.interrupted = 0;
125 #ifdef BACKLIGHT_ENABLE 245 } else {
126 backlight_step(); 246 unregister_mods(MOD_LALT);
127 #endif 247
128 } else { 248 if (record->tap.count && !record->tap.interrupted) {
129 unregister_code(KC_RSFT); 249 add_weak_mods(MOD_LSFT);
130 } 250 register_code(KC_LBRACKET);
131 break; 251 unregister_code(KC_LBRACKET);
252 del_weak_mods(MOD_LSFT);
253 }
254
255 record->tap.count = 0;
132 } 256 }
133 return MACRO_NONE; 257 break;
134}; 258 case RALT_BRACE:
259 if (record->event.pressed) {
260 register_mods(MOD_RALT);
261 record->tap.interrupted = 0;
262 } else {
263 unregister_mods(MOD_RALT);
264
265 if (record->tap.count && !record->tap.interrupted) {
266 add_weak_mods(MOD_LSFT);
267 register_code(KC_RBRACKET);
268 unregister_code(KC_RBRACKET);
269 del_weak_mods(MOD_LSFT);
270 }
271
272 record->tap.count = 0;
273 }
274 break;
275 }
276 return MACRO_NONE;
277}
278
279#ifdef AUDIO_ENABLE
280
281float tone_startup[][2] = SONG(STARTUP_SOUND);
282float tone_qwerty[][2] = SONG(QWERTY_SOUND);
283float tone_colemak[][2] = SONG(COLEMAK_SOUND);
284float tone_plover[][2] = SONG(PLOVER_SOUND);
285float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
286float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
287float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
288
289#endif
290
291void persistant_default_layer_set(uint16_t default_layer) {
292 eeconfig_update_default_layer(default_layer);
293 default_layer_set(default_layer);
294}
295
296// Send PHROPB ({PLOVER:RESUME}).
297void plover_resume(void) {
298 register_code(PV_LP);
299 register_code(PV_LH);
300 register_code(PV_LR);
301 register_code(PV_O);
302 register_code(PV_RP);
303 register_code(PV_RB);
304 unregister_code(PV_LP);
305 unregister_code(PV_LH);
306 unregister_code(PV_LR);
307 unregister_code(PV_O);
308 unregister_code(PV_RP);
309 unregister_code(PV_RB);
310}
311
312// Send PHROF ({PLOVER:SUSPEND}).
313void plover_suspend(void) {
314 register_code(PV_LP);
315 register_code(PV_LH);
316 register_code(PV_LR);
317 register_code(PV_O);
318 register_code(PV_RF);
319 unregister_code(PV_LP);
320 unregister_code(PV_LH);
321 unregister_code(PV_LR);
322 unregister_code(PV_O);
323 unregister_code(PV_RF);
324}
325
326// Send PHROBG ({PLOVER:LOOKUP}).
327void plover_lookup(void) {
328 register_code(PV_LP);
329 register_code(PV_LH);
330 register_code(PV_LR);
331 register_code(PV_O);
332 register_code(PV_RB);
333 register_code(PV_RG);
334 unregister_code(PV_LP);
335 unregister_code(PV_LH);
336 unregister_code(PV_LR);
337 unregister_code(PV_O);
338 unregister_code(PV_RB);
339 unregister_code(PV_RG);
340}
341
342bool process_record_user(uint16_t keycode, keyrecord_t *record) {
343 switch (keycode) {
344 case QWERTY:
345 if (record->event.pressed) {
346 persistant_default_layer_set(1UL<<BASE_QWERTY_LAYER);
347 }
348 return false;
349 case COLEMAK:
350 if (record->event.pressed) {
351 persistant_default_layer_set(1UL<<BASE_COLEMAK_LAYER);
352 }
353 return false;
354 case LOWER:
355 if (record->event.pressed) {
356 layer_on(LOWER_LAYER);
357 update_tri_layer(LOWER_LAYER, RAISE_LAYER, KEYBOARD_LAYER);
358 } else {
359 layer_off(LOWER_LAYER);
360 update_tri_layer(LOWER_LAYER, RAISE_LAYER, KEYBOARD_LAYER);
361 }
362 return false;
363 case RAISE:
364 if (record->event.pressed) {
365 layer_on(RAISE_LAYER);
366 update_tri_layer(LOWER_LAYER, RAISE_LAYER, KEYBOARD_LAYER);
367 } else {
368 layer_off(RAISE_LAYER);
369 update_tri_layer(LOWER_LAYER, RAISE_LAYER, KEYBOARD_LAYER);
370 }
371 return false;
372 case STENO:
373 if (record->event.pressed) {
374 layer_off(RAISE_LAYER);
375 layer_off(LOWER_LAYER);
376 layer_off(KEYBOARD_LAYER);
377 layer_on(BASE_STENO_LAYER);
378 if (!eeconfig_is_enabled()) {
379 eeconfig_init();
380 }
381 keymap_config.raw = eeconfig_read_keymap();
382 keymap_config.nkro = 1;
383 eeconfig_update_keymap(keymap_config.raw);
384 plover_resume();
385 }
386 return false;
387 case PV_EXIT:
388 if (record->event.pressed) {
389 plover_suspend();
390 layer_off(BASE_STENO_LAYER);
391 }
392 return false;
393 case PV_LOOK:
394 if (record->event.pressed) {
395 plover_lookup();
396 }
397 return false;
398 }
399 return true;
400}
401
402void matrix_init_user(void) {
403#ifdef AUDIO_ENABLE
404 startup_user();
405#endif
406}