aboutsummaryrefslogtreecommitdiff
path: root/keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c')
-rw-r--r--keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c359
1 files changed, 359 insertions, 0 deletions
diff --git a/keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c b/keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c
new file mode 100644
index 000000000..aed9d9762
--- /dev/null
+++ b/keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c
@@ -0,0 +1,359 @@
1/* Copyright 2019 Thomas Baart <thomas@splitkb.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18uint16_t copy_paste_timer;
19
20enum layers {
21 QWERTY = 0,
22 LOWER,
23 RAISE,
24 NAV,
25 ADJUST
26};
27
28enum custom_keycodes {
29 KC_CCCV = SAFE_RANGE
30};
31
32const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
33/*
34 * Base Layer: QWERTY
35 *
36 * ,-------------------------------------------. ,-------------------------------------------.
37 * | ESC | Q | W | E | R | T | | Y | U | I | O | P | | \ |
38 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
39 * | LSFT | A | S | D | F | G | | H | J | K | L | ; : | ' " |
40 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
41 * | LCTL | Z | X | C | V | B | CCCV | | | Del |Leader| N | M | , < | . > | / ? | - _ |
42 * `----------------------+------+------+------+------+ | |------+------+------+------+------+----------------------'
43 * | GUI | Alt | | Space| Enter| | Bspc | Space| | Tab | AltGr|
44 * | | | Lower| Shift| Alt | | | Nav | Raise| | |
45 * `----------------------------------' `----------------------------------'
46 */
47 [QWERTY] = LAYOUT(
48 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE,
49 KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
50 KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_CCCV, XXXXXXX, KC_DEL, KC_LEAD, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS,
51 KC_LGUI, KC_LALT, MO(LOWER), MT(MOD_LSFT, KC_SPC), MT(MOD_LALT, KC_ENT), KC_BSPC, LT(NAV, KC_SPC), MO(RAISE), KC_TAB, KC_RALT
52 ),
53/*
54 * Lower Layer: Numpad, Media
55 *
56 * ,-------------------------------------------. ,-------------------------------------------.
57 * | | | | VolUp| | | | / ? | 7 & | 8 * | 9 ( | - _ | |
58 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
59 * | | | Prev | Play | Next | | | * | 4 $ | 5 % | 6 ^ | , < | + |
60 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
61 * | | | | VolDn| Mute | | | | | | | 0 ) | 1 ! | 2 @ | 3 # | = + | |
62 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
63 * | | | | | | | | | | | |
64 * | | | Lower| | | | | Nav | Raise| | |
65 * `----------------------------------' `----------------------------------'
66 */
67 [LOWER] = LAYOUT(
68 _______, _______, _______, KC_VOLU, _______, _______, KC_SLSH, KC_7, KC_8, KC_9, KC_MINS, _______,
69 _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_ASTR, KC_4, KC_5, KC_6, KC_COMM, KC_PLUS,
70 _______, _______, _______, KC_VOLD, KC_MUTE, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_EQL, _______,
71 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
72 ),
73/*
74 * Raise Layer: Symbols
75 *
76 * ,-------------------------------------------. ,-------------------------------------------.
77 * | | ! | @ | { | } | | | | | _ | € | | | \ |
78 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
79 * | | # | $ | ( | ) | ` | | + | - | / | * | % | ' " |
80 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
81 * | | % | ^ | [ | ] | ~ | | | | | | & | = | , | . | / ? | - _ |
82 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
83 * | | | | | | | | | | | |
84 * | | | Lower| | | | | Nav | Raise| | |
85 * `----------------------------------' `----------------------------------'
86 */
87 [RAISE] = LAYOUT(
88 _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, KC_UNDS, ALGR(KC_5),_______,_______,KC_BSLS,
89 _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT,
90 _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, _______, _______, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS,
91 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
92 ),
93/*
94 * Navigation Layer
95 *
96 * ,-------------------------------------------. ,-------------------------------------------.
97 * | | | | | | | | PgUp | Home | Up | End | | ScrlLk |
98 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
99 * | | | | | | | | PgDn | Left | Down | Right| | CapsLk |
100 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
101 * | | | | | | | | | | | | | | | | | |
102 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
103 * | | | | | | | | | | | |
104 * | | | Lower| | | | | Nav | Raise| | |
105 * `----------------------------------' `----------------------------------'
106 */
107 [NAV] = LAYOUT(
108 _______, _______, _______, _______, _______, _______, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, KC_SLCK,
109 _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_CAPS,
110 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
111 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
112 ),
113/*
114 * Adjust Layer
115 *
116 * ,-------------------------------------------. ,-------------------------------------------.
117 * | | | | | | | | | F7 | F8 | F9 | F10 | |
118 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
119 * | | | SAI | HUI | VAI | | | | F4 | F5 | F6 | F11 | |
120 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
121 * | | | SAD | HUD | VAD | | | | | | | | F1 | F2 | F3 | F12 | |
122 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
123 * | | | | | | | | | | | |
124 * | | | | | | | | | | | |
125 * `----------------------------------' `----------------------------------'
126 */
127 [ADJUST] = LAYOUT(
128 _______, _______, _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, _______,
129 _______, _______, RGB_SAI, RGB_HUI, RGB_VAI, _______, _______, KC_F4, KC_F5, KC_F6, KC_F11, _______,
130 _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F12, _______,
131 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
132 ),
133// /*
134// * Layer template
135// *
136// * ,-------------------------------------------. ,-------------------------------------------.
137// * | | | | | | | | | | | | | |
138// * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
139// * | | | | | | | | | | | | | |
140// * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
141// * | | | | | | | | | | | | | | | | | |
142// * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
143// * | | | | | | | | | | | |
144// * | | | | | | | | | | | |
145// * `----------------------------------' `----------------------------------'
146// */
147// [_LAYERINDEX] = LAYOUT(
148// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
149// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
150// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
151// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
152// ),
153};
154
155layer_state_t layer_state_set_user(layer_state_t state) {
156 return update_tri_layer_state(state, LOWER, RAISE, ADJUST);
157}
158
159bool process_record_user(uint16_t keycode, keyrecord_t *record) {
160 switch (keycode) {
161 case KC_CCCV: // One key copy/paste
162 if (record->event.pressed) {
163 copy_paste_timer = timer_read();
164 } else {
165 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
166 tap_code16(LCTL(KC_C));
167 } else { // Tap, paste
168 tap_code16(LCTL(KC_V));
169 }
170 }
171 break;
172 }
173 return true;
174}
175
176
177bool is_alt_tab_active = false;
178uint16_t alt_tab_timer = 0;
179
180LEADER_EXTERNS();
181
182void matrix_scan_user(void) {
183 if (is_alt_tab_active) {
184 if (timer_elapsed(alt_tab_timer) > 1000) {
185 unregister_code(KC_LALT);
186 is_alt_tab_active = false;
187 }
188 }
189
190 LEADER_DICTIONARY() {
191 leading = false;
192 leader_end();
193
194 SEQ_ONE_KEY(KC_C) { // Inline Code
195 SEND_STRING("`` " SS_TAP(X_LEFT) SS_TAP(X_LEFT));
196 }
197 SEQ_ONE_KEY(KC_P) { // Invoke Password Manager
198 SEND_STRING(SS_LCTRL(SS_LALT("\\")));
199 }
200 SEQ_ONE_KEY(KC_S) { // Windows screenshot
201 SEND_STRING(SS_LGUI("\nS"));
202 }
203 SEQ_TWO_KEYS(KC_F, KC_P) { // Fusion Projection prefix
204 SEND_STRING("[Projection] ");
205 }
206 SEQ_TWO_KEYS(KC_B, KC_B) { // Basecone invoice description
207 SEND_STRING("[Leveranciersnaam] [Factuurnummer]");
208 }
209 SEQ_TWO_KEYS(KC_E, KC_S) { // Support email splitkb
210 SEND_STRING("support@splitkb.com");
211 }
212 SEQ_TWO_KEYS(KC_E, KC_T) { // Email splitkb
213 SEND_STRING("thomas@splitkb.com");
214 }
215 SEQ_TWO_KEYS(KC_E, KC_P) { // Email personal
216 SEND_STRING("mail@thomasbaart.nl");
217 }
218 SEQ_TWO_KEYS(KC_S, KC_D) { // Splitkb documentation
219 SEND_STRING("https://docs.splitkb.com/");
220 }
221 SEQ_TWO_KEYS(KC_S, KC_V) { // Splitkb VAT number
222 SEND_STRING("NL210593349B01");
223 }
224 SEQ_TWO_KEYS(KC_B, KC_C) { // Discord bongocat
225 SEND_STRING(":bongocat:\n");
226 }
227 SEQ_TWO_KEYS(KC_C, KC_B) { // Discord code block
228 SEND_STRING("```c" SS_LSFT("\n\n") "``` " SS_TAP(X_UP));
229 }
230 SEQ_TWO_KEYS(KC_Y, KC_S) { // Greeting
231 SEND_STRING("Yours sincerely,\n\nThomas Baart");
232 }
233 SEQ_THREE_KEYS(KC_M, KC_V, KC_G) { // Greeting
234 SEND_STRING("Met vriendelijke groet,\n\nThomas Baart");
235 }
236 }
237}
238
239#ifdef OLED_DRIVER_ENABLE
240oled_rotation_t oled_init_user(oled_rotation_t rotation) {
241 return OLED_ROTATION_180;
242}
243
244static void render_kyria_logo(void) {
245 static const char PROGMEM kyria_logo[] = {
246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,192,224,240,112,120, 56, 60, 28, 30, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 30, 28, 60, 56,120,112,240,224,192,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
247 0, 0, 0, 0, 0, 0, 0,192,224,240,124, 62, 31, 15, 7, 3, 1,128,192,224,240,120, 56, 60, 28, 30, 14, 14, 7, 7,135,231,127, 31,255,255, 31,127,231,135, 7, 7, 14, 14, 30, 28, 60, 56,120,240,224,192,128, 1, 3, 7, 15, 31, 62,124,240,224,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
248 0, 0, 0, 0,240,252,255, 31, 7, 1, 0, 0,192,240,252,254,255,247,243,177,176, 48, 48, 48, 48, 48, 48, 48,120,254,135, 1, 0, 0,255,255, 0, 0, 1,135,254,120, 48, 48, 48, 48, 48, 48, 48,176,177,243,247,255,254,252,240,192, 0, 0, 1, 7, 31,255,252,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
249 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,254,255,255, 1, 1, 7, 30,120,225,129,131,131,134,134,140,140,152,152,177,183,254,248,224,255,255,224,248,254,183,177,152,152,140,140,134,134,131,131,129,225,120, 30, 7, 1, 1,255,255,254, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0,255,255, 0, 0,192,192, 48, 48, 0, 0,240,240, 0, 0, 0, 0, 0, 0,240,240, 0, 0,240,240,192,192, 48, 48, 48, 48,192,192, 0, 0, 48, 48,243,243, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48,192,192, 0, 0, 0, 0, 0,
250 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,127,255,255,128,128,224,120, 30,135,129,193,193, 97, 97, 49, 49, 25, 25,141,237,127, 31, 7,255,255, 7, 31,127,237,141, 25, 25, 49, 49, 97, 97,193,193,129,135, 30,120,224,128,128,255,255,127, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 63, 63, 3, 3, 12, 12, 48, 48, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51, 15, 15, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 63, 63, 48, 48, 0, 0, 12, 12, 51, 51, 51, 51, 51, 51, 63, 63, 0, 0, 0, 0, 0,
251 0, 0, 0, 0, 15, 63,255,248,224,128, 0, 0, 3, 15, 63,127,255,239,207,141, 13, 12, 12, 12, 12, 12, 12, 12, 30,127,225,128, 0, 0,255,255, 0, 0,128,225,127, 30, 12, 12, 12, 12, 12, 12, 12, 13,141,207,239,255,127, 63, 15, 3, 0, 0,128,224,248,255, 63, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
252 0, 0, 0, 0, 0, 0, 0, 3, 7, 15, 62,124,248,240,224,192,128, 1, 3, 7, 15, 30, 28, 60, 56,120,112,112,224,224,225,231,254,248,255,255,248,254,231,225,224,224,112,112,120, 56, 60, 28, 30, 15, 7, 3, 1,128,192,224,240,248,124, 62, 15, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
253 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7, 15, 14, 30, 28, 60, 56,120,112,112,112,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,112,112,112,120, 56, 60, 28, 30, 14, 15, 7, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
254 };
255 oled_write_raw_P(kyria_logo, sizeof(kyria_logo));
256}
257
258static void render_qmk_logo(void) {
259 static const char PROGMEM qmk_logo[] = {
260 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
261 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
262 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
263
264 oled_write_P(qmk_logo, false);
265}
266
267static void render_status(void) {
268 // QMK Logo and version information
269 render_qmk_logo();
270 oled_write_P(PSTR(" Kyria rev1.0\n\n"), false);
271
272 // Host Keyboard Layer Status
273 oled_write_P(PSTR("Layer: "), false);
274 switch (get_highest_layer(layer_state)) {
275 case QWERTY:
276 oled_write_P(PSTR("Default\n"), false);
277 break;
278 case LOWER:
279 oled_write_P(PSTR("Lower\n"), false);
280 break;
281 case RAISE:
282 oled_write_P(PSTR("Raise\n"), false);
283 break;
284 case NAV:
285 oled_write_P(PSTR("Navigation\n"), false);
286 break;
287 case ADJUST:
288 oled_write_P(PSTR("Adjust\n"), false);
289 break;
290 default:
291 oled_write_P(PSTR("Undefined\n"), false);
292 }
293
294 // Host Keyboard LED Status
295 uint8_t led_usb_state = host_keyboard_leds();
296 oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
297 oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
298 oled_write_P(IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
299}
300
301void oled_task_user(void) {
302 if (is_keyboard_master()) {
303 render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
304 } else {
305 render_kyria_logo();
306 }
307}
308#endif
309
310#ifdef ENCODER_ENABLE
311bool encoder_update_user(uint8_t index, bool clockwise) {
312 if (index == 0) {
313 switch (biton32(layer_state)) {
314 case QWERTY:
315 // History scrubbing. For Adobe products, hold shift while moving
316 // backward to go forward instead.
317 if (clockwise) {
318 tap_code16(C(KC_Z));
319 } else {
320 tap_code16(C(KC_Y));
321 }
322 break;
323 default:
324 // Switch between windows on Windows with alt tab.
325 if (clockwise) {
326 if (!is_alt_tab_active) {
327 is_alt_tab_active = true;
328 register_code(KC_LALT);
329 }
330 alt_tab_timer = timer_read();
331 tap_code16(KC_TAB);
332 } else {
333 tap_code16(S(KC_TAB));
334 }
335 break;
336 }
337 } else if (index == 1) {
338 switch (biton32(layer_state)) {
339 case QWERTY:
340 // Scrolling with PageUp and PgDn.
341 if (clockwise) {
342 tap_code(KC_PGDN);
343 } else {
344 tap_code(KC_PGUP);
345 }
346 break;
347 default:
348 // Volume control.
349 if (clockwise) {
350 tap_code(KC_VOLU);
351 } else {
352 tap_code(KC_VOLD);
353 }
354 break;
355 }
356 }
357 return true;
358}
359#endif