aboutsummaryrefslogtreecommitdiff
path: root/keyboards/manyboard/macro/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/manyboard/macro/keymaps/default/keymap.c')
-rw-r--r--keyboards/manyboard/macro/keymaps/default/keymap.c84
1 files changed, 43 insertions, 41 deletions
diff --git a/keyboards/manyboard/macro/keymaps/default/keymap.c b/keyboards/manyboard/macro/keymaps/default/keymap.c
index 4feda5080..0b9d2ac92 100644
--- a/keyboards/manyboard/macro/keymaps/default/keymap.c
+++ b/keyboards/manyboard/macro/keymaps/default/keymap.c
@@ -15,59 +15,61 @@
15 */ 15 */
16#include QMK_KEYBOARD_H 16#include QMK_KEYBOARD_H
17 17
18 18// clang-format off
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT_ortho_4x4( 20 [0] = LAYOUT_ortho_4x4(
21 KC_F1, KC_F2, KC_F3, KC_F4, 21 KC_F1, KC_F2, KC_F3, KC_F4,
22 KC_F5, KC_F6, KC_F7, KC_F8, 22 KC_F5, KC_F6, KC_F7, KC_F8,
23 KC_F9, KC_F10, KC_F11, KC_F12, 23 KC_F9, KC_F10, KC_F11, KC_F12,
24 KC_F13, KC_F14, KC_F15, TO(1) 24 KC_F13, KC_F14, KC_F15, TO(1)
25 ), 25 ),
26 [1] = LAYOUT_ortho_4x4( 26 [1] = LAYOUT_ortho_4x4(
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
29 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 29 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30 KC_TRNS, KC_TRNS, KC_TRNS, TO(2) 30 KC_TRNS, KC_TRNS, KC_TRNS, TO(2)
31 ), 31 ),
32 [2] = LAYOUT_ortho_4x4( 32 [2] = LAYOUT_ortho_4x4(
33 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 33 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, TO(0) 36 KC_TRNS, KC_TRNS, KC_TRNS, TO(0)
37 ), 37 ),
38}; 38};
39// clang-format on
39 40
40layer_state_t layer_state_set_user(layer_state_t state) { 41layer_state_t layer_state_set_user(layer_state_t state) {
41 switch (get_highest_layer(state)) { 42 switch (get_highest_layer(state)) {
42 case 0: 43 case 0:
43 sethsv(HSV_WHITE, (LED_TYPE *)&led[0]); 44 sethsv(HSV_WHITE, (LED_TYPE *)&led[0]);
44 rgblight_set(); 45 rgblight_set();
45 break; 46 break;
46 case 1: 47 case 1:
47 sethsv(HSV_GREEN, (LED_TYPE *)&led[0]); 48 sethsv(HSV_GREEN, (LED_TYPE *)&led[0]);
48 rgblight_set(); 49 rgblight_set();
49 break; 50 break;
50 case 2: 51 case 2:
51 sethsv(HSV_BLUE, (LED_TYPE *)&led[0]); 52 sethsv(HSV_BLUE, (LED_TYPE *)&led[0]);
52 rgblight_set(); 53 rgblight_set();
53 break; 54 break;
54 } 55 }
55 return state; 56 return state;
56} 57}
57 58
58void encoder_update_user(uint8_t index, bool clockwise) { 59bool encoder_update_user(uint8_t index, bool clockwise) {
59 /* With an if statement we can check which encoder was turned. */ 60 /* With an if statement we can check which encoder was turned. */
60 if (index == 0) { /* First encoder */ 61 if (index == 0) { /* First encoder */
61 /* And with another if statement we can check the direction. */ 62 /* And with another if statement we can check the direction. */
62 if (clockwise) { 63 if (clockwise) {
63 /* This is where the actual magic happens: this bit of code taps on the 64 /* This is where the actual magic happens: this bit of code taps on the
64 Page Down key. You can do anything QMK allows you to do here. 65 Page Down key. You can do anything QMK allows you to do here.
65 You'll want to replace these lines with the things you want your 66 You'll want to replace these lines with the things you want your
66 encoders to do. */ 67 encoders to do. */
67 tap_code(KC_AUDIO_VOL_UP); 68 tap_code(KC_AUDIO_VOL_UP);
68 } else { 69 } else {
69 /* And likewise for the other direction, this time Vol Down is pressed. */ 70 /* And likewise for the other direction, this time Vol Down is pressed. */
70 tap_code(KC_AUDIO_VOL_DOWN); 71 tap_code(KC_AUDIO_VOL_DOWN);
72 }
71 } 73 }
72 } 74 return true;
73} 75}