diff options
Diffstat (limited to 'keyboards/draytronics/daisy/keymaps/default/keymap.c')
-rw-r--r-- | keyboards/draytronics/daisy/keymaps/default/keymap.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/keyboards/draytronics/daisy/keymaps/default/keymap.c b/keyboards/draytronics/daisy/keymaps/default/keymap.c new file mode 100644 index 000000000..396fcd9dd --- /dev/null +++ b/keyboards/draytronics/daisy/keymaps/default/keymap.c | |||
@@ -0,0 +1,51 @@ | |||
1 | /*Copyright 2021 Blake Drayson / Draytronics | ||
2 | |||
3 | Contact info@draytronics.co.uk | ||
4 | |||
5 | This program is free software: you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation, either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #include QMK_KEYBOARD_H | ||
20 | #define _BASE 0 // Base layer | ||
21 | #define _CODE 1 // Code layer | ||
22 | |||
23 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
24 | [_BASE] = LAYOUT_daisy( | ||
25 | KC_MUTE, KC_HOME, | ||
26 | MO(_CODE), KC_MPRV, KC_MNXT, KC_MPLY, | ||
27 | C(KC_LEFT), C(KC_UP), C(KC_DOWN), C(KC_RIGHT) | ||
28 | ), | ||
29 | [_CODE] = LAYOUT_daisy( | ||
30 | KC_MUTE, KC_END, | ||
31 | _______, RGB_MOD, RGB_VAI, RGB_TOG, | ||
32 | G(S(KC_5)), G(A(KC_ESC)), G(KC_F), RESET | ||
33 | ) | ||
34 | }; | ||
35 | |||
36 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
37 | if (index == 0) { | ||
38 | if (clockwise) { | ||
39 | tap_code(KC_VOLD); | ||
40 | } else { | ||
41 | tap_code(KC_VOLU); | ||
42 | } | ||
43 | } | ||
44 | else if (index == 1) { | ||
45 | if (clockwise) { | ||
46 | tap_code(KC_PGUP); | ||
47 | } else { | ||
48 | tap_code(KC_PGDN); | ||
49 | } | ||
50 | } | ||
51 | } | ||