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