diff options
Diffstat (limited to 'keyboards/custommk/genesis/rev2/keymaps/numpad/keymap.c')
-rw-r--r-- | keyboards/custommk/genesis/rev2/keymaps/numpad/keymap.c | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/keyboards/custommk/genesis/rev2/keymaps/numpad/keymap.c b/keyboards/custommk/genesis/rev2/keymaps/numpad/keymap.c new file mode 100644 index 000000000..e6b84c3f6 --- /dev/null +++ b/keyboards/custommk/genesis/rev2/keymaps/numpad/keymap.c | |||
@@ -0,0 +1,89 @@ | |||
1 | /* Copyright 2020 customMK | ||
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 | //#define GENESIS_LAYER_COLORS | ||
20 | #define GENESIS_LAYER1_COLOR HSV_CYAN | ||
21 | #define GENESIS_LAYER2_COLOR HSV_GREEN | ||
22 | #define GENESIS_LAYER3_COLOR HSV_WHITE | ||
23 | |||
24 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
25 | |||
26 | [0] = LAYOUT_numpad_5x4( | ||
27 | MO(1), KC_PSLS, KC_PAST, KC_PMNS, | ||
28 | KC_P7, KC_P8, KC_P9, | ||
29 | KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
30 | KC_P1, KC_P2, KC_P3, | ||
31 | KC_P0, KC_PDOT, KC_ENT), | ||
32 | |||
33 | [1] = LAYOUT_numpad_5x4( | ||
34 | KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, | ||
35 | KC_TRNS, KC_TRNS, KC_TRNS, | ||
36 | RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, | ||
37 | KC_TRNS, KC_TRNS, KC_TRNS, | ||
38 | RGB_HUI, KC_TRNS, RGB_HUD), | ||
39 | |||
40 | [2] = LAYOUT_numpad_5x4( | ||
41 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
42 | KC_TRNS, KC_TRNS, KC_TRNS, | ||
43 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
44 | KC_TRNS, KC_TRNS, KC_TRNS, | ||
45 | KC_TRNS, KC_TRNS, KC_TRNS), | ||
46 | |||
47 | [3] = LAYOUT_numpad_5x4( | ||
48 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
49 | KC_TRNS, KC_TRNS, KC_TRNS, | ||
50 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
51 | KC_TRNS, KC_TRNS, KC_TRNS, | ||
52 | KC_TRNS, KC_TRNS, KC_TRNS), | ||
53 | |||
54 | }; | ||
55 | |||
56 | |||
57 | #ifdef GENESIS_LAYER_COLORS | ||
58 | const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
59 | {0,13,GENESIS_LAYER1_COLOR} | ||
60 | ); | ||
61 | |||
62 | const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
63 | {0,13,GENESIS_LAYER2_COLOR} | ||
64 | ); | ||
65 | |||
66 | const rgblight_segment_t PROGMEM my_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
67 | {0,13,GENESIS_LAYER3_COLOR} | ||
68 | ); | ||
69 | |||
70 | |||
71 | const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( | ||
72 | my_layer1_layer, | ||
73 | my_layer2_layer, | ||
74 | my_layer3_layer | ||
75 | ); | ||
76 | |||
77 | //Set the appropriate layer color | ||
78 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
79 | rgblight_set_layer_state(0, layer_state_cmp(state, 1)); | ||
80 | rgblight_set_layer_state(1, layer_state_cmp(state, 2)); | ||
81 | rgblight_set_layer_state(2, layer_state_cmp(state, 3)); | ||
82 | return state; | ||
83 | } | ||
84 | |||
85 | void keyboard_post_init_user(void) { | ||
86 | //Enable the LED layers | ||
87 | rgblight_layers = my_rgb_layers; | ||
88 | } | ||
89 | #endif \ No newline at end of file | ||