aboutsummaryrefslogtreecommitdiff
path: root/keyboards/yeehaw/keymaps/via/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/yeehaw/keymaps/via/keymap.c')
-rw-r--r--keyboards/yeehaw/keymaps/via/keymap.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/keyboards/yeehaw/keymaps/via/keymap.c b/keyboards/yeehaw/keymaps/via/keymap.c
new file mode 100644
index 000000000..43fc3aee5
--- /dev/null
+++ b/keyboards/yeehaw/keymaps/via/keymap.c
@@ -0,0 +1,90 @@
1 /* Copyright 2021 Caleb Lightfoot
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
17#include QMK_KEYBOARD_H
18
19
20enum custom_keycodes {
21 YEEHAW = SAFE_RANGE,
22 SQUASHKB,
23};
24
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26
27 [0] = LAYOUT(
28 KC_VOLU,
29 KC_VOLD,
30 KC_MPRV, YEEHAW, KC_UP, SQUASHKB,
31 MO(1), KC_MNXT, KC_LEFT, KC_DOWN, KC_RIGHT,
32 KC_MPLY, LCTL(KC_S),
33 RGB_TOG
34 ),
35
36 [1] = LAYOUT(
37 RGB_HUI,
38 RGB_HUD,
39 RGB_SAI, RGB_VAI, RGB_VAD, RGB_SPI,
40KC_TRNS, RGB_SAD, RGB_M_P, RGB_MOD, RGB_SPD,
41 KC_TRNS, KC_TRNS,
42 RESET
43 ),
44
45 [2] = LAYOUT(
46 ____,
47 ____,
48 ____, ____, ____, ____,
49____, ____, ____, ____, ____,
50 ____, ____,
51 ____
52 ),
53
54 [3] = LAYOUT(
55 ____,
56 ____,
57 ____, ____, ____, ____,
58____, ____, ____, ____, ____,
59 ____, ____,
60 ____
61 ),
62
63};
64
65void encoder_update_user(uint8_t index, bool clockwise) {
66 if (index == 0) { /* First encoder */
67 if (clockwise) {
68 tap_code(KC_VOLD);
69 } else {
70 tap_code(KC_VOLU);
71 }
72 }
73}
74
75bool process_record_user(uint16_t keycode, keyrecord_t *record) {
76 switch (keycode) {
77 case YEEHAW:
78 if (record->event.pressed) {
79 SEND_STRING("yeehaw!");
80 }
81 break;
82
83 case SQUASHKB:
84 if (record->event.pressed) {
85 SEND_STRING("http://squashkb.com");
86 }
87 break;
88 }
89 return true;
90};