diff options
author | Akshay <[email protected]> | 2022-04-10 12:13:40 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2022-04-10 12:13:40 +0100 |
commit | dc90387ce7d8ba7b607d9c48540bf6d8b560f14d (patch) | |
tree | 4ccb8fa5886b66fa9d480edef74236c27f035e16 /keyboards/custommk/genesis/rev2/keymaps |
Diffstat (limited to 'keyboards/custommk/genesis/rev2/keymaps')
7 files changed, 346 insertions, 0 deletions
diff --git a/keyboards/custommk/genesis/rev2/keymaps/default/keymap.c b/keyboards/custommk/genesis/rev2/keymaps/default/keymap.c new file mode 100644 index 000000000..7ba558ca9 --- /dev/null +++ b/keyboards/custommk/genesis/rev2/keymaps/default/keymap.c | |||
@@ -0,0 +1,76 @@ | |||
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 | |||
25 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
26 | |||
27 | [0] = LAYOUT_ortho_5x4( | ||
28 | MO(1), KC_PSLS, KC_PAST, KC_PMNS, | ||
29 | KC_P7, KC_P8, KC_P9, KC_BSPC, | ||
30 | KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
31 | KC_P1, KC_P2, KC_P3, KC_CAPS, | ||
32 | KC_P0, KC_SPC, KC_PDOT, KC_ENT), | ||
33 | |||
34 | [1] = LAYOUT_ortho_5x4( | ||
35 | KC_TRNS, KC_VOLU, RGB_TOG, RGB_MOD, | ||
36 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
37 | RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, | ||
38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
39 | RGB_HUI, KC_TRNS, KC_TRNS, RGB_HUD), | ||
40 | |||
41 | }; | ||
42 | |||
43 | |||
44 | #ifdef GENESIS_LAYER_COLORS | ||
45 | const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
46 | {0,13,GENESIS_LAYER1_COLOR} | ||
47 | ); | ||
48 | |||
49 | const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
50 | {0,13,GENESIS_LAYER2_COLOR} | ||
51 | ); | ||
52 | |||
53 | const rgblight_segment_t PROGMEM my_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
54 | {0,13,GENESIS_LAYER3_COLOR} | ||
55 | ); | ||
56 | |||
57 | |||
58 | const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( | ||
59 | my_layer1_layer, | ||
60 | my_layer2_layer, | ||
61 | my_layer3_layer | ||
62 | ); | ||
63 | |||
64 | //Set the appropriate layer color | ||
65 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
66 | rgblight_set_layer_state(0, layer_state_cmp(state, 1)); | ||
67 | rgblight_set_layer_state(1, layer_state_cmp(state, 2)); | ||
68 | rgblight_set_layer_state(2, layer_state_cmp(state, 3)); | ||
69 | return state; | ||
70 | } | ||
71 | |||
72 | void keyboard_post_init_user(void) { | ||
73 | //Enable the LED layers | ||
74 | rgblight_layers = my_rgb_layers; | ||
75 | } | ||
76 | #endif \ No newline at end of file | ||
diff --git a/keyboards/custommk/genesis/rev2/keymaps/default/readme.md b/keyboards/custommk/genesis/rev2/keymaps/default/readme.md new file mode 100644 index 000000000..202402d83 --- /dev/null +++ b/keyboards/custommk/genesis/rev2/keymaps/default/readme.md | |||
@@ -0,0 +1,6 @@ | |||
1 | # Default Genesis Macro Pad Layout | ||
2 | |||
3 | This is the default layout for the Genesis Macro Pad. It assumes all 1u switches | ||
4 | and optional rotary encoder in the top-left or top-right corner for media volume | ||
5 | control. The top left switch activates Layer 1 which enables control of the RGB | ||
6 | underglow. \ No newline at end of file | ||
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 | ||
diff --git a/keyboards/custommk/genesis/rev2/keymaps/numpad/readme.md b/keyboards/custommk/genesis/rev2/keymaps/numpad/readme.md new file mode 100644 index 000000000..795e4341a --- /dev/null +++ b/keyboards/custommk/genesis/rev2/keymaps/numpad/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # Numpad Genesis Macro Pad Layout | ||
2 | |||
3 | This is the numpad layout for the Genesis Macro Pad. It assumes the 0, +, and enter keys are all 2u size, with an optional rotary encoder in the top-left or top-right corner for media volume control. The top left switch activates Layer 1 which enables control of the RGB underglow. \ No newline at end of file | ||
diff --git a/keyboards/custommk/genesis/rev2/keymaps/via/keymap.c b/keyboards/custommk/genesis/rev2/keymaps/via/keymap.c new file mode 100644 index 000000000..eb0f7772c --- /dev/null +++ b/keyboards/custommk/genesis/rev2/keymaps/via/keymap.c | |||
@@ -0,0 +1,167 @@ | |||
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 | |||
25 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
26 | |||
27 | [0] = LAYOUT_via_6x4( | ||
28 | KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, | ||
29 | MO(1), KC_PSLS, KC_PAST, KC_PMNS, | ||
30 | KC_P7, KC_P8, KC_P9, KC_PGUP, | ||
31 | KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
32 | KC_P1, KC_P2, KC_P3, KC_PGDN, | ||
33 | KC_P0, KC_SPC, KC_PDOT, KC_PENT), | ||
34 | |||
35 | [1] = LAYOUT_via_6x4( | ||
36 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
37 | KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, | ||
38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
39 | RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, | ||
40 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
41 | RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS), | ||
42 | |||
43 | [2] = LAYOUT_via_6x4( | ||
44 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
45 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
46 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
47 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
48 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
49 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | ||
50 | |||
51 | [3] = LAYOUT_via_6x4( | ||
52 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
53 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
54 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
55 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
56 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
57 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | ||
58 | |||
59 | }; | ||
60 | |||
61 | #ifdef GENESIS_LAYER_COLORS | ||
62 | const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
63 | {0,13,GENESIS_LAYER1_COLOR} | ||
64 | ); | ||
65 | |||
66 | const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
67 | {0,13,GENESIS_LAYER2_COLOR} | ||
68 | ); | ||
69 | |||
70 | const rgblight_segment_t PROGMEM my_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
71 | {0,13,GENESIS_LAYER3_COLOR} | ||
72 | ); | ||
73 | |||
74 | |||
75 | const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( | ||
76 | my_layer1_layer, | ||
77 | my_layer2_layer, | ||
78 | my_layer3_layer | ||
79 | ); | ||
80 | |||
81 | //Set the appropriate layer color | ||
82 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
83 | rgblight_set_layer_state(0, layer_state_cmp(state, 1)); | ||
84 | rgblight_set_layer_state(1, layer_state_cmp(state, 2)); | ||
85 | rgblight_set_layer_state(2, layer_state_cmp(state, 3)); | ||
86 | return state; | ||
87 | } | ||
88 | |||
89 | void keyboard_post_init_user(void) { | ||
90 | //Enable the LED layers | ||
91 | rgblight_layers = my_rgb_layers; | ||
92 | } | ||
93 | #endif | ||
94 | |||
95 | |||
96 | keyevent_t encoder_left_ccw = { | ||
97 | .key = (keypos_t){.row = 5, .col = 0}, | ||
98 | .pressed = false | ||
99 | }; | ||
100 | |||
101 | keyevent_t encoder_left_cw = { | ||
102 | .key = (keypos_t){.row = 5, .col = 1}, | ||
103 | .pressed = false | ||
104 | }; | ||
105 | |||
106 | keyevent_t encoder_right_ccw = { | ||
107 | .key = (keypos_t){.row = 5, .col = 2}, | ||
108 | .pressed = false | ||
109 | }; | ||
110 | |||
111 | keyevent_t encoder_right_cw = { | ||
112 | .key = (keypos_t){.row = 5, .col = 3}, | ||
113 | .pressed = false | ||
114 | }; | ||
115 | |||
116 | void matrix_scan_user(void) { | ||
117 | if (IS_PRESSED(encoder_left_ccw)) { | ||
118 | encoder_left_ccw.pressed = false; | ||
119 | encoder_left_ccw.time = (timer_read() | 1); | ||
120 | action_exec(encoder_left_ccw); | ||
121 | } | ||
122 | |||
123 | if (IS_PRESSED(encoder_left_cw)) { | ||
124 | encoder_left_cw.pressed = false; | ||
125 | encoder_left_cw.time = (timer_read() | 1); | ||
126 | action_exec(encoder_left_cw); | ||
127 | } | ||
128 | |||
129 | if (IS_PRESSED(encoder_right_ccw)) { | ||
130 | encoder_right_ccw.pressed = false; | ||
131 | encoder_right_ccw.time = (timer_read() | 1); | ||
132 | action_exec(encoder_right_ccw); | ||
133 | } | ||
134 | |||
135 | if (IS_PRESSED(encoder_right_cw)) { | ||
136 | encoder_right_cw.pressed = false; | ||
137 | encoder_right_cw.time = (timer_read() | 1); | ||
138 | action_exec(encoder_right_cw); | ||
139 | } | ||
140 | |||
141 | } | ||
142 | |||
143 | |||
144 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
145 | if (index == 0) { | ||
146 | if (clockwise) { | ||
147 | encoder_left_cw.pressed = true; | ||
148 | encoder_left_cw.time = (timer_read() | 1); | ||
149 | action_exec(encoder_left_cw); | ||
150 | } else { | ||
151 | encoder_left_ccw.pressed = true; | ||
152 | encoder_left_ccw.time = (timer_read() | 1); | ||
153 | action_exec(encoder_left_ccw); | ||
154 | } | ||
155 | } else { | ||
156 | if (clockwise) { | ||
157 | encoder_right_cw.pressed = true; | ||
158 | encoder_right_cw.time = (timer_read() | 1); | ||
159 | action_exec(encoder_right_cw); | ||
160 | } else { | ||
161 | encoder_right_ccw.pressed = true; | ||
162 | encoder_right_ccw.time = (timer_read() | 1); | ||
163 | action_exec(encoder_right_ccw); | ||
164 | } | ||
165 | } | ||
166 | return false; | ||
167 | } | ||
diff --git a/keyboards/custommk/genesis/rev2/keymaps/via/readme.md b/keyboards/custommk/genesis/rev2/keymaps/via/readme.md new file mode 100644 index 000000000..aa70d6225 --- /dev/null +++ b/keyboards/custommk/genesis/rev2/keymaps/via/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # Genesis Macro Pad Layout for VIA | ||
2 | |||
3 | This is the via layout for the Genesis Macro Pad. It is identical to the default 1u layout which assumes all 1u switches and optional rotary encoder in the top-left or top-right corner for media volume control. The top-left switch activates Layer 1 which enables control of the RGB underglow. \ No newline at end of file | ||
diff --git a/keyboards/custommk/genesis/rev2/keymaps/via/rules.mk b/keyboards/custommk/genesis/rev2/keymaps/via/rules.mk new file mode 100644 index 000000000..43061db1d --- /dev/null +++ b/keyboards/custommk/genesis/rev2/keymaps/via/rules.mk | |||
@@ -0,0 +1,2 @@ | |||
1 | VIA_ENABLE = yes | ||
2 | LTO_ENABLE = yes \ No newline at end of file | ||