aboutsummaryrefslogtreecommitdiff
path: root/keyboards/gmmk
diff options
context:
space:
mode:
authorDrashna Jael're <drashna@live.com>2021-09-17 18:39:16 -0700
committerDrashna Jael're <drashna@live.com>2021-09-17 18:39:16 -0700
commitc14abd8c14f512ca160f99a942734b0f652a453c (patch)
tree8a944dd15388348b4a7f8c79f5e6bf9061289d83 /keyboards/gmmk
parentefde8d657ac43d7b007437caa72dee96e149e94a (diff)
parent7c09b2667b49839d6c1a27133751d43642149a84 (diff)
downloadqmk_firmware-c14abd8c14f512ca160f99a942734b0f652a453c.tar.gz
qmk_firmware-c14abd8c14f512ca160f99a942734b0f652a453c.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/gmmk')
-rw-r--r--keyboards/gmmk/pro/ansi/keymaps/mattgauf/ansi.c241
-rw-r--r--keyboards/gmmk/pro/ansi/keymaps/mattgauf/config.h63
-rw-r--r--keyboards/gmmk/pro/ansi/keymaps/mattgauf/helpers.c25
-rw-r--r--keyboards/gmmk/pro/ansi/keymaps/mattgauf/keymap.c220
-rw-r--r--keyboards/gmmk/pro/ansi/keymaps/mattgauf/keymap_helpers.h165
-rw-r--r--keyboards/gmmk/pro/ansi/keymaps/mattgauf/readme.md52
-rw-r--r--keyboards/gmmk/pro/ansi/keymaps/mattgauf/rules.mk6
7 files changed, 772 insertions, 0 deletions
diff --git a/keyboards/gmmk/pro/ansi/keymaps/mattgauf/ansi.c b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/ansi.c
new file mode 100644
index 000000000..b09af297b
--- /dev/null
+++ b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/ansi.c
@@ -0,0 +1,241 @@
1/* Copyright 2021 Gigahawk
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// clang-format off
18#include "ansi.h"
19
20#ifdef RGB_MATRIX_ENABLE
21led_config_t __flash g_led_config = {{
22 { 4, NO_LED, NO_LED, 95, 65, 79, 5, 28 },
23 { 8, 2, 9, 0, 10, 75, 1, 7 },
24 { 14, 3, 15, NO_LED, 16, 86, 6, 13 },
25 { 20, 18, 21, 23, 22, 94, 12, 19 },
26 { 25, 30, 26, 31, 27, 32, 29, 24 },
27 { 41, 36, 42, 37, 43, 38, 35, 40 },
28 { 46, 89, 47, 34, 48, 72, 78, 45 },
29 { 52, 39, 53, 97, 54, 82, 44, 51 },
30 { 58, 63, 59, 64, NO_LED, 60, 62, 57 },
31 { 11, 90, 55, 17, 33, 49, NO_LED, 69 },
32 { NO_LED, 85, 93, 61, 96, 66, 50, 56 }
33}, {
34 {0, 0}, // 0, ESC, k13
35 {0, 15}, // 1, ~, k16
36 {4, 26}, // 2, Tab, k11
37 {5, 38}, // 3, Caps, k21
38 {9, 49}, // 4, Sh_L, k00
39 {2, 61}, // 5, Ct_L, k06
40 {18, 0}, // 6, F1, k26
41 {14, 15}, // 7, 1, k17
42 {22, 26}, // 8, Q, k10
43 {25, 38}, // 9, A, k12
44 {33, 49}, // 10, Z, k14
45 {20, 61}, // 11, Win_L, k90
46 {33, 0}, // 12, F2, k36
47 {29, 15}, // 13, 2, k27
48 {36, 26}, // 14, W, k20
49 {40, 38}, // 15, S, k22
50 {47, 49}, // 16, X, k24
51 {38, 61}, // 17, Alt_L, k93
52 {47, 0}, // 18, F3, k31
53 {43, 15}, // 19, 3, k37
54 {51, 26}, // 20, E, k30
55 {54, 38}, // 21, D, k32
56 {61, 49}, // 22, C, k34
57 {61, 0}, // 23, F4, k33
58 {58, 15}, // 24, 4, k47
59 {65, 26}, // 25, R, k40
60 {69, 38}, // 26, F, k42
61 {76, 49}, // 27, V, k44
62 {79, 0}, // 28, F5, k07
63 {72, 15}, // 29, 5, k46
64 {79, 26}, // 30, T, k41
65 {83, 38}, // 31, G, k43
66 {90, 49}, // 32, B, k45
67 {92, 61}, // 33, SPACE, k94
68 {94, 0}, // 34, F6, k63
69 {87, 15}, // 35, 6, k56
70 {94, 26}, // 36, Y, k51
71 {98, 38}, // 37, H, k53
72 {105, 49}, // 38, N, k55
73 {108, 0}, // 39, F7, k71
74 {101, 15}, // 40, 7, k57
75 {108, 26}, // 41, U, k50
76 {112, 38}, // 42, J, k52
77 {119, 49}, // 43, M, k54
78 {123, 0}, // 44, F8, k76
79 {116, 15}, // 45, 8, k67
80 {123, 26}, // 46, I, k60
81 {126, 38}, // 47, K, k62
82 {134, 49}, // 48, ,, k64
83 {145, 61}, // 49, Alt_R, k95
84 {141, 0}, // 50, F9, ka6
85 {130, 15}, // 51, 9, k77
86 {137, 26}, // 52, O, k70
87 {141, 38}, // 53, L, k72
88 {148, 49}, // 54, ., k74
89 {159, 61}, // 55, FN, k92
90 {155, 0}, // 56, F10, ka7
91 {145, 15}, // 57, 0, k87
92 {152, 26}, // 58, P, k80
93 {155, 38}, // 59, ;, k82
94 {163, 49}, // 60, ?, k85
95 {170, 0}, // 61, F11, ka3
96 {159, 15}, // 62, -, k86
97 {166, 26}, // 63, [, k81
98 {170, 38}, // 64, ", k83
99 {173, 61}, // 65, Ct_R, k04
100 {184, 0}, // 66, F12, ka5
101 {0, 8}, // 67, LED, l01
102 {224, 8}, // 68, LED, l11
103 {202, 0}, // 69, Prt, k97
104 {0, 15}, // 70, LED, l02
105 {224, 15}, // 71, LED, l12
106 {224, 15}, // 72, Del, k65
107 {0, 21}, // 73, LED, l03
108 {224, 21}, // 74, LED, l13
109 {224, 26}, // 75, PgUp, k15
110 {0, 28}, // 76, LED, l04
111 {224, 28}, // 77, LED, l14
112 {173, 15}, // 78, =, k66
113 {220, 64}, // 79, Right, k05
114 {0, 35}, // 80, LED, l05
115 {224, 35}, // 81, LED, l15
116 {224, 49}, // 82, End, k75
117 {0, 42}, // 83, LED, l06
118 {224, 42}, // 84, LED, l16
119 {195, 15}, // 85, BSpc, ka1
120 {224, 38}, // 86, PgDn, k25
121 {0, 48}, // 87, LED, l07
122 {224, 48}, // 88, LED, l17
123 {181, 26}, // 89, ], k61
124 {182, 49}, // 90, Sh_R, k91
125 {0, 55}, // 91, LED, l08
126 {224, 55}, // 92, LED, l18
127 {199, 26}, // 93, \, ka2
128 {206, 52}, // 94, Up, k35
129 {191, 64}, // 95, Left, k03
130 {193, 38}, // 96, Enter, ka4
131 {206, 64} // 97, Down, k73
132}, {
133 4, 4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
134 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
135 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 2, 2, 4, 2, 2,
136 4, 2, 2, 4, 4, 2, 2, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 4, 4, 4
137}};
138
139const aw_led g_aw_leds[DRIVER_LED_TOTAL] = {
140 {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, ESC, k13
141 {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 1, ~, k16
142 {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 2, Tab, k11
143 {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 3, Caps, k21
144 {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 4, Sh_L, k00
145 {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 5, Ct_L, k06
146 {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 6, F1, k26
147 {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 7, 1, k17
148 {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 8, Q, k10
149 {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 9, A, k12
150 {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 10, Z, k14
151 {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 11, Win_L, k90
152 {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 12, F2, k36
153 {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 13, 2, k27
154 {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 14, W, k20
155 {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 15, S, k22
156 {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 16, X, k24
157 {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 17, Alt_L, k93
158 {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 18, F3, k31
159 {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 19, 3, k37
160 {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 20, E, k30
161 {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 21, D, k32
162 {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 22, C, k34
163 {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 23, F4, k33
164 {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 24, 4, k47
165 {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 25, R, k40
166 {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 26, F, k42
167 {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 27, V, k44
168 {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 28, F5, k07
169 {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 29, 5, k46
170 {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 30, T, k41
171 {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 31, G, k43
172 {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 32, B, k45
173 {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 33, SPACE, k94
174 {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 34, F6, k63
175 {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 35, 6, k56
176 {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 36, Y, k51
177 {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 37, H, k53
178 {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 38, N, k55
179 {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 39, F7, k71
180 {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 40, 7, k57
181 {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 41, U, k50
182 {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 42, J, k52
183 {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 43, M, k54
184 {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 44, F8, k76
185 {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 45, 8, k67
186 {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 46, I, k60
187 {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 47, K, k62
188 {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 48, ,, k64
189 {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 49, Alt_R, k95
190 {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 50, F9, ka6
191 {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 51, 9, k77
192 {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 52, O, k70
193 {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 53, L, k72
194 {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 54, ., k74
195 {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 55, FN, k92
196 {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 56, F10, ka7
197 {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 57, 0, k87
198 {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 58, P, k80
199 {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 59, ;, k82
200 {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 60, ?, k85
201 {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 61, F11, ka3
202 {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 62, -, k86
203 {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 63, [, k81
204 {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 64, ", k83
205 {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 65, Ct_R, k04
206
207 {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 66, F12, ka5
208 {1, CS13_SW1, CS14_SW1, CS15_SW1}, // 67, LED, l01
209 {1, CS16_SW1, CS17_SW1, CS18_SW1}, // 68, LED, l11
210 {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 69, Prt, k97
211 {1, CS13_SW2, CS14_SW2, CS15_SW2}, // 70, LED, l02
212 {1, CS16_SW2, CS17_SW2, CS18_SW2}, // 71, LED, l12
213 {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 72, Del, k65
214 {1, CS13_SW3, CS14_SW3, CS15_SW3}, // 73, LED, l03
215 {1, CS16_SW3, CS17_SW3, CS18_SW3}, // 74, LED, l13
216 {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 75, PgUp, k15
217 {1, CS13_SW4, CS14_SW4, CS15_SW4}, // 76, LED, l04
218 {1, CS16_SW4, CS17_SW4, CS18_SW4}, // 77, LED, l14
219 {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 78, =, k66
220 {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 79, Right, k05
221 {1, CS13_SW5, CS14_SW5, CS15_SW5}, // 80, LED, l05
222 {1, CS16_SW5, CS17_SW5, CS18_SW5}, // 81, LED, l15
223 {1, CS4_SW6, CS5_SW6, CS6_SW6}, // 82, End, k75
224 {1, CS13_SW6, CS14_SW6, CS15_SW6}, // 83, LED, l06
225 {1, CS16_SW6, CS17_SW6, CS18_SW6}, // 84, LED, l16
226 {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 85, BSpc, ka1
227 {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 86, PgDn, k25
228 {1, CS13_SW7, CS14_SW7, CS15_SW7}, // 87, LED, l07
229 {1, CS16_SW7, CS17_SW7, CS18_SW7}, // 88, LED, l17
230 {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 89, ], k61
231 {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 90, Sh_R, k91
232 {1, CS13_SW8, CS14_SW8, CS15_SW8}, // 91, LED, l08
233 {1, CS16_SW8, CS17_SW8, CS18_SW8}, // 92, LED, l18
234 {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 93, \, ka2
235 {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 94, Up, k35
236 {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 95, Left, k03
237 {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 96, Enter, ka4
238 {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 97, Down, k73
239};
240// clang-format on
241#endif
diff --git a/keyboards/gmmk/pro/ansi/keymaps/mattgauf/config.h b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/config.h
new file mode 100644
index 000000000..26417b823
--- /dev/null
+++ b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/config.h
@@ -0,0 +1,63 @@
1/* Copyright 2021 Matt Gauf
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// clang-format off
18#pragma once
19
20/* Defaults */
21#define RAW_USAGE_PAGE 0x200
22#define RAW_USAGE_ID 0x40
23
24/* Board Features */
25#define DYNAMIC_MACRO_SIZE 512
26
27/* RGB Matrix Features */
28#define RGB_MATRIX_KEYPRESSES
29#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR
30#define RGB_DISABLE_WHEN_USB_SUSPENDED true
31
32/* RGB Matrix Framebuffer Config */
33// #define RGB_MATRIX_FRAMEBUFFER_EFFECTS
34// #define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 25
35
36/* RGB Matrix Disabled Effects */
37#define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue, speed is hue for secondary hue
38#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation
39#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness
40#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in
41#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard
42#define DISABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard
43#define DISABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard
44#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard
45#define DISABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue
46#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation
47#define DISABLE_RGB_MATRIX_HUE_PENDULUM // Hue shifts up a slight ammount in a wave to the right, then back to the left
48#define DISABLE_RGB_MATRIX_HUE_WAVE // Hue shifts up a slight ammount and then back down in a wave to the right
49
50#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
51 #define DISABLE_RGB_MATRIX_DIGITAL_RAIN // That famous computer simulation
52#endif
53
54#if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
55 #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out
56 #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out
57 #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out
58 #define DISABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out
59 #define DISABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out
60#endif
61
62#define DISABLE_RGB_MATRIX_EFFECT_MAX
63// clang-format on
diff --git a/keyboards/gmmk/pro/ansi/keymaps/mattgauf/helpers.c b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/helpers.c
new file mode 100644
index 000000000..f3f443ced
--- /dev/null
+++ b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/helpers.c
@@ -0,0 +1,25 @@
1/* Copyright 2021 Matt Gauf
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 "rgb_matrix.h"
18
19void rgb_matrix_set_color_flags(uint8_t red, uint8_t green, uint8_t blue, uint8_t flags) {
20 for (uint8_t ii = 0; ii < DRIVER_LED_TOTAL; ii++) {
21 if (g_led_config.flags[ii] & flags) {
22 rgb_matrix_set_color(ii, red, green, blue);
23 }
24 }
25}
diff --git a/keyboards/gmmk/pro/ansi/keymaps/mattgauf/keymap.c b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/keymap.c
new file mode 100644
index 000000000..f96be6ffe
--- /dev/null
+++ b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/keymap.c
@@ -0,0 +1,220 @@
1/* Copyright 2021 Matt Gauf
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// clang-format off
18#include QMK_KEYBOARD_H
19#include "keymap_helpers.h"
20
21
22enum custom_codes {
23 SET_MP = RGB_M_P,
24 SET_MB = RGB_M_B,
25 SET_MR = RGB_M_R,
26
27 MG_F17 = SAFE_RANGE,
28 MG_F18,
29 MG_F19
30};
31
32
33enum layer_names {
34 _DEFAULT = 0,
35 _EFFECTS,
36 _UTILITY,
37 _DFUMODE
38};
39
40
41// static uint8_t rgb_pin_fn_column[] = {PIN_DEL,PIN_PGUP,PIN_PGDN,PIN_END};
42// static uint8_t rgb_pin_left_underglow[] = {PIN_LED_L01,PIN_LED_L02,PIN_LED_L03,PIN_LED_L04,PIN_LED_L05,PIN_LED_L06,PIN_LED_L07,PIN_LED_L08};
43// static uint8_t rgb_pin_right_underglow[] = {PIN_LED_L11,PIN_LED_L12,PIN_LED_L13,PIN_LED_L14,PIN_LED_L15,PIN_LED_L16,PIN_LED_L17,PIN_LED_L18};
44
45
46#define MODS_SHIFT ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT)
47#define MODS_CTRL ((get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL)
48#define MODS_ALT ((get_mods() | get_oneshot_mods()) & MOD_MASK_ALT)
49#define MODS_GUI ((get_mods() | get_oneshot_mods()) & MOD_MASK_GUI)
50
51
52const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
53 [_DEFAULT] = LAYOUT(KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MG_F17, KC_MUTE,
54 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,
55 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
56 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
57 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
58 KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(_EFFECTS), KC_LEFT, KC_DOWN, KC_RGHT),
59
60 [_EFFECTS] = LAYOUT(_______, KC_F13, KC_F14, KC_F15, KC_F16, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, MG_F18, _______,
61 _______, SET_MP, SET_MB, SET_MR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD,
62 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD,
63 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPI,
64 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, RGB_SAI, RGB_SPD,
65 _______, _______, _______, _______, TG(_UTILITY), MO(_DFUMODE), _______, RGB_HUD, RGB_SAD, RGB_HUI),
66
67 [_UTILITY] = LAYOUT(_______, _______, _______, _______, _______, _______, _______, _______, _______, DM_PLY1, DM_PLY2, DM_REC1, DM_REC2, DM_RSTP, _______,
68 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
69 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
70 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
71 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
72 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
73
74 [_DFUMODE] = LAYOUT(RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MG_F19, DEBUG,
75 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
76 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
77 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
78 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
79 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
80};
81// Runs constantly in the background, in a loop.
82void rgb_matrix_indicators_user(void) {
83 if (rgb_matrix_get_flags() & (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER)) {
84
85 if (IS_LAYER_ON(_UTILITY)) {
86 rgb_matrix_set_color(PIN_F9, LEDGREE);
87 rgb_matrix_set_color(PIN_F10, LEDGREE);
88 rgb_matrix_set_color(PIN_F11, LED_RED);
89 rgb_matrix_set_color(PIN_F12, LED_RED);
90 rgb_matrix_set_color(PIN_PRINT, LEDTEAL);
91 }
92
93 switch (get_highest_layer(layer_state)) {
94 case _DFUMODE:
95 rgb_matrix_set_color_all(LED_OFF);
96 rgb_matrix_set_color(PIN_ESC, LED_RED);
97 rgb_matrix_set_color(PIN_PRINT, LEDORAN);
98 return;
99 case _EFFECTS:
100 rgb_matrix_set_color(PIN_PRINT, LEDGREE);
101 break;
102 default:
103 break;
104 }
105
106 if (host_keyboard_led_state().caps_lock) {
107 rgb_matrix_set_color(PIN_CAPS, RGB_WHITE);
108 }
109
110 }
111}
112
113
114// Called on start
115void dynamic_macro_record_start_user(void) {
116 dprint("-- Recording Started\n");
117 layer_on(_UTILITY);
118}
119
120
121// Called on end
122void dynamic_macro_record_end_user(int8_t direction) {
123 dprint("-- Recording Ended\n");
124}
125
126
127// Called on playback
128void dynamic_macro_play_user(int8_t direction) {
129 dprint("-- Recording Playing\n");
130}
131
132
133// Runs on encoder event
134bool encoder_update_user(uint8_t index, bool clockwise) {
135 uint8_t curr_mod = get_mods();
136
137 if (IS_LAYER_ON(_EFFECTS)) {
138 if (clockwise) {
139 rgb_matrix_increase_val();
140 } else {
141 rgb_matrix_decrease_val();
142 }
143 } else {
144 if (MODS_GUI) {
145 if (MODS_GUI && MODS_SHIFT) {
146 clear_mods();
147 if (clockwise) {
148 tap_code16(LSG(KC_Z));
149 } else {
150 tap_code16(LGUI(KC_Z));
151 }
152 set_mods(curr_mod);
153 } else if (MODS_GUI && MODS_ALT) {
154 clear_mods();
155 if (clockwise) {
156 tap_code(KC_RIGHT);
157 } else {
158 tap_code(KC_LEFT);
159 }
160 set_mods(curr_mod);
161 } else {
162 if (clockwise) {
163 tap_code16(LGUI(KC_TAB));
164 } else {
165 tap_code16(LSG(KC_TAB));
166 }
167 }
168 } else {
169 if (clockwise) {
170 tap_code(KC_VOLU);
171 } else {
172 tap_code(KC_VOLD);
173 }
174 }
175 }
176 return true;
177}
178
179
180// Runs on key event
181bool process_record_user(uint16_t keycode, keyrecord_t *record) {
182 switch (keycode) {
183 case MG_F17:
184 if (record->event.pressed) {
185 tap_code16(HYPR(KC_F17));
186 }
187 return false;
188 case MG_F18:
189 if (record->event.pressed) {
190 tap_code16(HYPR(KC_F18));
191 }
192 return false;
193 case MG_F19:
194 if (record->event.pressed) {
195 tap_code16(HYPR(KC_F19));
196 }
197 return false;
198 case RGB_TOG:
199 if (record->event.pressed) {
200 switch (rgb_matrix_get_flags()) {
201 case LED_FLAG_ALL:
202 rgb_matrix_set_flags(LED_FLAG_NONE);
203 break;
204 case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER:
205 rgb_matrix_set_flags(LED_FLAG_ALL);
206 break;
207 case LED_FLAG_UNDERGLOW:
208 rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
209 break;
210 default:
211 rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
212 break;
213 }
214 }
215 return false;
216 default:
217 return true; // Process all other keycodes normally
218 }
219}
220// clang-format on
diff --git a/keyboards/gmmk/pro/ansi/keymaps/mattgauf/keymap_helpers.h b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/keymap_helpers.h
new file mode 100644
index 000000000..2a6e8dae7
--- /dev/null
+++ b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/keymap_helpers.h
@@ -0,0 +1,165 @@
1/* Copyright 2021 Matt Gauf
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// clang-format off
18#include <inttypes.h>
19#include "rgb_matrix_types.h"
20
21/* Color Codes */
22#define LEDWHIT 0xff, 0xff, 0xff
23#define LED_RED 0xff, 0x00, 0x00
24#define LEDORAN 0xff, 0x29, 0x00
25#define LEDGOLD 0xff, 0x80, 0x00
26#define LEDYELL 0xff, 0xff, 0x00
27#define LEDCHAR 0x80, 0xff, 0x00
28#define LEDGREE 0x00, 0xff, 0x00
29#define LEDFOAM 0x00, 0xff, 0x40
30#define LEDTEAL 0x00, 0x80, 0xff
31#define LEDBLUE 0x00, 0x00, 0xff
32#define LEDPURP 0x80, 0x00, 0xff
33#define LEDMAGE 0xff, 0x00, 0xff
34#define LEDPINK 0xff, 0x00, 0x80
35#define LEDBLAC 0x00, 0x00, 0x00
36#define LED_OFF 0x00, 0x00, 0x00
37
38/* Color Functions */
39void rgb_matrix_set_color_flags(uint8_t red, uint8_t green, uint8_t blue, uint8_t flags);
40
41/* Function Row */
42#define PIN_ESC 0
43#define PIN_F1 6
44#define PIN_F2 12
45#define PIN_F3 18
46#define PIN_F4 23
47#define PIN_F5 28
48#define PIN_F6 34
49#define PIN_F7 39
50#define PIN_F8 44
51#define PIN_F9 50
52#define PIN_F10 56
53#define PIN_F11 61
54#define PIN_F12 66
55#define PIN_PRINT 69
56
57/* Number Row */
58#define PIN_0 57
59#define PIN_1 7
60#define PIN_2 13
61#define PIN_3 19
62#define PIN_4 24
63#define PIN_5 29
64#define PIN_6 35
65#define PIN_7 40
66#define PIN_8 45
67#define PIN_9 51
68
69/* QWERTY */
70#define PIN_A 9
71#define PIN_B 32
72#define PIN_C 22
73#define PIN_D 21
74#define PIN_E 20
75#define PIN_F 26
76#define PIN_G 31
77#define PIN_H 37
78#define PIN_I 46
79#define PIN_J 42
80#define PIN_K 47
81#define PIN_L 53
82#define PIN_M 43
83#define PIN_N 38
84#define PIN_O 52
85#define PIN_P 58
86#define PIN_Q 8
87#define PIN_R 25
88#define PIN_S 15
89#define PIN_T 30
90#define PIN_U 41
91#define PIN_V 27
92#define PIN_W 14
93#define PIN_X 16
94#define PIN_Y 36
95#define PIN_Z 10
96
97/* Symbols */
98#define PIN_MINUS 62
99#define PIN_EQUAL 78
100#define PIN_RBRACKET 89
101#define PIN_LBRACKET 63
102#define PIN_BSLASH 93
103#define PIN_SLASH 60
104#define PIN_SCOLON 59
105#define PIN_QUOTE 64
106#define PIN_COMMA 48
107#define PIN_DOT 54
108#define PIN_GRAVE 1
109
110/* Indentation */
111#define PIN_TAB 2
112#define PIN_SPACE 33
113
114/* Line Control */
115#define PIN_BSPACE 85
116#define PIN_ENTER 96
117
118/* Indicator */
119#define PIN_CAPS 3
120
121/* Left Modifiers */
122#define PIN_LSHIFT 4
123#define PIN_LCTRL 5
124#define PIN_LALT 17
125#define PIN_LGUI 11
126
127/* Right Modifiers */
128#define PIN_RSHIFT 90
129#define PIN_RCTRL 65
130#define PIN_RALT 49
131#define PIN_FN 55
132
133/* Arrow Keys */
134#define PIN_UP 94
135#define PIN_DOWN 97
136#define PIN_LEFT 95
137#define PIN_RIGHT 79
138
139/* Fn Column */
140#define PIN_DEL 72 // ┳ TOP
141#define PIN_PGUP 75 // ┃
142#define PIN_PGDN 86 // ┃
143#define PIN_END 82 // ┻ BOTTOM
144
145/* Left Side Underglow */
146#define PIN_LED_L01 67 // ┳ TOP
147#define PIN_LED_L02 70 // ┃
148#define PIN_LED_L03 73 // ┃
149#define PIN_LED_L04 76 // ┃
150#define PIN_LED_L05 80 // ┃
151#define PIN_LED_L06 83 // ┃
152#define PIN_LED_L07 87 // ┃
153#define PIN_LED_L08 91 // ┻ BOTTOM
154
155/* Right Side Underglow */
156#define PIN_LED_L11 68 // ┳ TOP
157#define PIN_LED_L12 71 // ┃
158#define PIN_LED_L13 74 // ┃
159#define PIN_LED_L14 77 // ┃
160#define PIN_LED_L15 81 // ┃
161#define PIN_LED_L16 84 // ┃
162#define PIN_LED_L17 88 // ┃
163#define PIN_LED_L18 92 // ┻ BOTTOM
164
165// clang-format on
diff --git a/keyboards/gmmk/pro/ansi/keymaps/mattgauf/readme.md b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/readme.md
new file mode 100644
index 000000000..f388a3fbf
--- /dev/null
+++ b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/readme.md
@@ -0,0 +1,52 @@
1# @mattgauf's GMMK Pro layout
2
3### `_DEFAULT`
4> *Based on the default ansi layout, this keymap contains the following changes to the default layer.*
5 - Screensaver: `HYPER(F17)`
6 - `KC_PSCR` → `MG_F17`
7 - `KC_DEL` → `KC_HOME`
8
9> *Additionally the encoder will follow new rules when holding a key.*
10 - `KC_GUI` will cycle through applications (macOS variant)
11 - `KC_GUI + KC_ALT` will tap the left and right arrows.
12 - `KC_GUI + KC_SHIFT` will tap Undo and Redo (macOS variant)
13
14### `_EFFECTS`
15> *The function layer is now used for additional layer access, effect keys, and media keys (following the Macbook Pro fn key layout).*
16
17> *Additionally while effects is active, the encoder will only adjust the brightness of the RGB matrix.*
18 - The RGB matrix effect and speed keys are located on the right hand vertical nav column.
19 - `KC_HOME` → `RGB_MOD`
20 - `KC_PGUP` → `RGB_RMOD`
21 - `KC_PGDN` → `RGB_SPI`
22 - `KC_END` → `RGB_SPD`
23 - The RGB matrix Hue, Saturation keys are mapped to the arrow keys.
24 - `KC_UP` → `RGB_SAI`
25 - `KC_DN` → `RGB_SAD`
26 - `KC_LEFT` → `RGB_HUD`
27 - `KC_RIGHT` → `RGB_HUI`
28 - The RGB matrix toggle is intercepted in process_record_user() cycling through the `LED_FLAG` modifiers. (`NONE`, `UNDERGLOW`, `KEYLIGHT`, `ALL`)
29 - `KC_SLSH` → `RGB_TOG`
30 - Hibernate: `HYPER(F18)`
31 - `MG_F17` → `MG_F18`
32
33
34### `_UTILITY`
35*The utility layer is currently used for remapping* `KF_F9` *to* `KC_F12` *&* `MG_F17` *to the dynamic macro keys.*
36 - Playback
37 - `KC_F9` → `DM_PLY1`
38 - `KC_F10` → `DM_PLY2`
39 - Record
40 - `KC_F11` → `DM_REC1`
41 - `KC_F12` → `DM_REC2`
42 - Stop Recording
43 - `MG_F17` → `DM_RSTP`
44
45### `_DFUMODE`
46> *The final layer is used for resetting the board or triggering an immediate shutdown.*
47 - DFU Mode
48 - `KC_ESC` → `RESET`
49 - Shutdown: `HYPER(F19)`
50 - `MG_F17` → `MG_F19`
51 - Encoder press, triggers debug output.
52 - `KC_MUTE` → `DEBUG`
diff --git a/keyboards/gmmk/pro/ansi/keymaps/mattgauf/rules.mk b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/rules.mk
new file mode 100644
index 000000000..76e1674d5
--- /dev/null
+++ b/keyboards/gmmk/pro/ansi/keymaps/mattgauf/rules.mk
@@ -0,0 +1,6 @@
1# Build rules
2LIB_SRC += ansi.c
3LIB_SRC += helpers.c
4
5# Overrides
6MOUSEKEY_ENABLE = no # Mouse keys