aboutsummaryrefslogtreecommitdiff
path: root/keyboards/dmqdesign/spin/keymaps
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/dmqdesign/spin/keymaps')
-rw-r--r--keyboards/dmqdesign/spin/keymaps/codecoffeecode/config.h19
-rw-r--r--keyboards/dmqdesign/spin/keymaps/codecoffeecode/keymap.c52
-rw-r--r--keyboards/dmqdesign/spin/keymaps/default/config.h21
-rw-r--r--keyboards/dmqdesign/spin/keymaps/default/keymap.c48
-rw-r--r--keyboards/dmqdesign/spin/keymaps/default/readme.md1
-rw-r--r--keyboards/dmqdesign/spin/keymaps/encoderlayers/config.h22
-rw-r--r--keyboards/dmqdesign/spin/keymaps/encoderlayers/keymap.c152
-rw-r--r--keyboards/dmqdesign/spin/keymaps/encoderlayers/readme.md1
-rw-r--r--keyboards/dmqdesign/spin/keymaps/gorbachev/config.h25
-rw-r--r--keyboards/dmqdesign/spin/keymaps/gorbachev/keymap.c249
-rw-r--r--keyboards/dmqdesign/spin/keymaps/gorbachev/readme.md7
-rw-r--r--keyboards/dmqdesign/spin/keymaps/gorbachev/rules.mk4
-rw-r--r--keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h42
-rw-r--r--keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c238
-rw-r--r--keyboards/dmqdesign/spin/keymaps/spidey3_pad/readme.md1
-rw-r--r--keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk7
-rw-r--r--keyboards/dmqdesign/spin/keymaps/via/keymap.c69
-rw-r--r--keyboards/dmqdesign/spin/keymaps/via/rules.mk1
18 files changed, 959 insertions, 0 deletions
diff --git a/keyboards/dmqdesign/spin/keymaps/codecoffeecode/config.h b/keyboards/dmqdesign/spin/keymaps/codecoffeecode/config.h
new file mode 100644
index 000000000..d736cc309
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/codecoffeecode/config.h
@@ -0,0 +1,19 @@
1/* Copyright 2020 codecoffeecode
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#pragma once
18
19#define RGBLIGHT_HUE_STEP 8 \ No newline at end of file
diff --git a/keyboards/dmqdesign/spin/keymaps/codecoffeecode/keymap.c b/keyboards/dmqdesign/spin/keymaps/codecoffeecode/keymap.c
new file mode 100644
index 000000000..d6653691b
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/codecoffeecode/keymap.c
@@ -0,0 +1,52 @@
1/* Copyright 2020 codecoffeecode
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#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT(
20 KC_HOME, KC_UP, KC_END, /*|*/ KC_TRNS,
21 KC_LEFT, KC_DOWN, KC_RIGHT, /*|*/ KC_TRNS,
22 KC_MPRV, KC_MPLY, KC_MNXT, /*|*/ KC_TRNS,
23 LCTL(LSFT(KC_ESC)), RGB_TOG, LGUI(KC_L)
24 ),
25};
26
27bool encoder_update_user(uint8_t index, bool clockwise) {
28 switch(index) {
29 case 0:
30 if (clockwise) {
31 tap_code(KC_VOLU); // Volume
32 } else {
33 tap_code(KC_VOLD);
34 }
35 break;
36 case 1:
37 if (clockwise) {
38 tap_code(KC_MS_WH_DOWN); // Scroll
39 } else {
40 tap_code(KC_MS_WH_UP);
41 }
42 break;
43 case 2:
44 if (clockwise) {
45 rgblight_increase_hue(); // RGB Hue
46 } else {
47 rgblight_decrease_hue();
48 }
49 break;
50 }
51 return true;
52}
diff --git a/keyboards/dmqdesign/spin/keymaps/default/config.h b/keyboards/dmqdesign/spin/keymaps/default/config.h
new file mode 100644
index 000000000..a6d4ee431
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/default/config.h
@@ -0,0 +1,21 @@
1/* Copyright 2019-2020 DMQ Design
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#pragma once
18
19#define RGBLIGHT_HUE_STEP 8
20
21// place overrides here
diff --git a/keyboards/dmqdesign/spin/keymaps/default/keymap.c b/keyboards/dmqdesign/spin/keymaps/default/keymap.c
new file mode 100644
index 000000000..ea6b518c3
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/default/keymap.c
@@ -0,0 +1,48 @@
1/* Copyright 2019-2020 DMQ Design
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#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT(/* Base */
20 KC_7, KC_8, KC_9, KC_TRNS,
21 KC_4, KC_5, KC_6, KC_TRNS,
22 KC_1, KC_2, KC_3, KC_TRNS,
23 KC_0, RGB_TOG, KC_ENTER
24 ),
25};
26
27bool encoder_update_user(uint8_t index, bool clockwise) {
28 if (index == 0) { /* First encoder */
29 if (clockwise) {
30 rgblight_increase_hue(); //Cycle through the RGB hue
31 } else {
32 rgblight_decrease_hue();
33 }
34 } else if (index == 1) { /* Second encoder */
35 if (clockwise) {
36 tap_code(KC_VOLU); //Example of using tap_code which lets you use keycodes outside of the keymap
37 } else {
38 tap_code(KC_VOLD);
39 }
40 } else if (index == 2) { /* Third encoder */
41 if (clockwise) {
42 rgblight_increase_val(); //Change brightness on the RGB LEDs
43 } else {
44 rgblight_decrease_val();
45 }
46 }
47 return true;
48}
diff --git a/keyboards/dmqdesign/spin/keymaps/default/readme.md b/keyboards/dmqdesign/spin/keymaps/default/readme.md
new file mode 100644
index 000000000..384b1a7d8
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for the SPIN Macro Pad, it includes basic encoder & rgb functionality. \ No newline at end of file
diff --git a/keyboards/dmqdesign/spin/keymaps/encoderlayers/config.h b/keyboards/dmqdesign/spin/keymaps/encoderlayers/config.h
new file mode 100644
index 000000000..8b04e7dd3
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/encoderlayers/config.h
@@ -0,0 +1,22 @@
1/* Copyright 2019-2020 DMQ Design
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#pragma once
18
19#define RGBLIGHT_EFFECT_RAINBOW_MOOD
20#define RGBLIGHT_HUE_STEP 8
21#define MIDI_ADVANCED
22
diff --git a/keyboards/dmqdesign/spin/keymaps/encoderlayers/keymap.c b/keyboards/dmqdesign/spin/keymaps/encoderlayers/keymap.c
new file mode 100644
index 000000000..100f821a6
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/encoderlayers/keymap.c
@@ -0,0 +1,152 @@
1/* Copyright 2019-2020 DMQ Design
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#include QMK_KEYBOARD_H
17#include "midi.h"
18#include "qmk_midi.h"
19
20enum layers
21{
22 _BL,
23 _FL,
24 _TL
25};
26
27uint8_t currentLayer;
28
29//The below layers are intentionally empty in order to give a good starting point for how to configure multiple layers.
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31 [_BL] = LAYOUT(/* Base */
32 KC_KP_7, KC_KP_8, KC_KP_9, TO(_BL),
33 KC_KP_4, KC_KP_5, KC_KP_6, TO(_FL),
34 KC_KP_1, KC_KP_2, KC_KP_3, TO(_TL),
35 KC_KP_0, RGB_TOG, RGB_MOD
36 ),
37
38 [_FL] = LAYOUT(/* Base */
39 KC_NO, KC_NO, KC_NO, KC_TRNS,
40 KC_NO, KC_NO, KC_NO, KC_TRNS,
41 KC_NO, KC_NO, KC_NO, KC_TRNS,
42 KC_MS_BTN1, KC_NO, KC_MS_BTN2
43 ),
44
45 [_TL] = LAYOUT(/* Base */
46 KC_NO, KC_NO, KC_NO, KC_TRNS,
47 KC_NO, KC_NO, KC_NO, KC_TRNS,
48 KC_NO, KC_NO, KC_NO, KC_TRNS,
49 KC_NO, KC_NO, KC_NO
50 )
51};
52
53bool encoder_update_user(uint8_t index, bool clockwise) {
54 if (index == 0) { /* First encoder */
55 switch (currentLayer) { //break each encoder update into a switch statement for the current layer
56 case _BL:
57 if (clockwise) {
58 rgblight_increase_hue();
59 } else {
60 rgblight_decrease_hue();
61 }
62 break;
63 case _FL:
64 if (clockwise) {
65 midi_send_cc(&midi_device, 0, 0x14, 1);
66 } else {
67 midi_send_cc(&midi_device, 0, 0x15, 1);
68 }
69 break;
70 case _TL:
71 if (clockwise) {
72 midi_send_cc(&midi_device, 0, 0x1A, 1);
73 } else {
74 midi_send_cc(&midi_device, 0, 0x1B, 1);
75 }
76 break;
77 }
78 } else if (index == 1) { /* Second encoder */
79 switch (currentLayer) {
80 case _BL:
81 if (clockwise) {
82 tap_code(KC_VOLU);
83 } else {
84 tap_code(KC_VOLD);
85 }
86 break;
87 case _FL:
88 if (clockwise) {
89 midi_send_cc(&midi_device, 0, 0x16, 1);
90 } else {
91 midi_send_cc(&midi_device, 0, 0x17, 1);
92 }
93 break;
94 case _TL:
95 if (clockwise) {
96 midi_send_cc(&midi_device, 0, 0x1C, 1);
97 } else {
98 midi_send_cc(&midi_device, 0, 0x1D, 1);
99 }
100 break;
101 }
102 } else if (index == 2) { /* Third encoder */
103 switch (currentLayer) {
104 case _BL:
105 if (clockwise) {
106 rgblight_increase_val();
107 } else {
108 rgblight_decrease_val();
109 }
110 break;
111 case _FL:
112 if (clockwise) {
113 midi_send_cc(&midi_device, 0, 0x18, 1);
114 } else {
115 midi_send_cc(&midi_device, 0, 0x19, 1);
116 }
117 break;
118 case _TL:
119 if (clockwise) {
120 midi_send_cc(&midi_device, 0, 0x1E, 1);
121 } else {
122 midi_send_cc(&midi_device, 0, 0x1F, 1);
123 }
124 break;
125 }
126 }
127 return true;
128}
129
130layer_state_t layer_state_set_user(layer_state_t state) { //This will run every time the layer is updated
131 currentLayer = get_highest_layer(state);
132
133 switch (currentLayer) {
134 case _BL:
135 setrgb(RGB_WHITE, &led[0]); //Set the top LED to white for the bottom layer
136 setrgb(0, 0, 0, &led[1]);
137 setrgb(0, 0, 0, &led[2]);
138 break;
139 case _FL:
140 setrgb(0, 0, 0, &led[0]); //Set the middle LED to white for the middle layer
141 setrgb(RGB_WHITE, &led[1]);
142 setrgb(0, 0, 0, &led[2]);
143 break;
144 case _TL:
145 setrgb(0, 0, 0, &led[0]);
146 setrgb(0, 0, 0, &led[1]);
147 setrgb(RGB_WHITE, &led[2]); //Set the bottom LED to white for the top layer
148 break;
149 }
150 rgblight_set();
151 return state;
152}
diff --git a/keyboards/dmqdesign/spin/keymaps/encoderlayers/readme.md b/keyboards/dmqdesign/spin/keymaps/encoderlayers/readme.md
new file mode 100644
index 000000000..256fb16d4
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/encoderlayers/readme.md
@@ -0,0 +1 @@
# This keymap is intended to demonstrate how to implement different encoder functions dependent on layer, and on how to implement MIDI control with encoders. \ No newline at end of file
diff --git a/keyboards/dmqdesign/spin/keymaps/gorbachev/config.h b/keyboards/dmqdesign/spin/keymaps/gorbachev/config.h
new file mode 100644
index 000000000..10201015e
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/gorbachev/config.h
@@ -0,0 +1,25 @@
1/* Copyright 2019-2020 DMQ Design
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#pragma once
18
19#define RGBLIGHT_ANIMATIONS
20#define RGBLIGHT_HUE_STEP 8
21
22// Use one or the other, determines the orientation of
23// the OLED display
24// #define RIGHT_HAND
25#define LEFT_HAND
diff --git a/keyboards/dmqdesign/spin/keymaps/gorbachev/keymap.c b/keyboards/dmqdesign/spin/keymaps/gorbachev/keymap.c
new file mode 100644
index 000000000..b41359c5b
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/gorbachev/keymap.c
@@ -0,0 +1,249 @@
1/* Copyright 2019-2020 DMQ Design
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#include QMK_KEYBOARD_H
17
18enum layers {
19 _NUMPAD,
20 _RGB,
21 _MACRO
22};
23
24enum custom_keycodes {
25 HELLO_WORLD = SAFE_RANGE,
26};
27
28//The below layers are intentionally empty in order to give a good starting point for how to configure multiple layers.
29const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
30 [_NUMPAD] = LAYOUT(/* Base */
31 KC_7, KC_8, KC_9, TO(_NUMPAD),
32 KC_4, KC_5, KC_6, TO(_RGB),
33 KC_1, KC_2, KC_3, TO(_MACRO),
34 KC_0, KC_DOT, KC_ENTER
35 ),
36
37 [_RGB] = LAYOUT(/* Base */
38 RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS,
39 RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS,
40 KC_NO, KC_NO, KC_NO, KC_TRNS,
41 RGB_RMOD, RGB_TOG, RGB_MOD
42 ),
43
44 [_MACRO] = LAYOUT(/* Base */
45 HELLO_WORLD, KC_NO, KC_NO, KC_TRNS,
46 KC_NO, KC_NO, KC_NO, KC_TRNS,
47 KC_NO, KC_NO, KC_NO, KC_TRNS,
48 KC_NO, KC_NO, KC_NO
49 )
50};
51
52bool process_record_user(uint16_t keycode, keyrecord_t *record) {
53 switch (keycode) {
54 case HELLO_WORLD:
55 if (record->event.pressed) {
56 SEND_STRING("Hello, world!");
57 }
58 break;
59 }
60
61 return true;
62};
63
64bool encoder_update_user(uint8_t index, bool clockwise) {
65 if (index == 0) { /* First encoder */
66 switch (get_highest_layer(layer_state)) { //break each encoder update into a switch statement for the current layer
67 case _NUMPAD:
68 if (clockwise) {
69 tap_code(KC_DOWN);
70 } else {
71 tap_code(KC_UP);
72 }
73 break;
74 case _RGB:
75 if (clockwise) {
76 rgblight_increase_hue();
77 } else {
78 rgblight_decrease_hue();
79 }
80 break;
81 case _MACRO:
82 if (clockwise) {
83 break;
84 } else {
85 break;
86 }
87 break;
88 }
89 } else if (index == 1) { /* Second encoder */
90 switch (get_highest_layer(layer_state)) {
91 case _NUMPAD:
92 if (clockwise) {
93 tap_code(KC_PGDN);
94 } else {
95 tap_code(KC_PGUP);
96 }
97 break;
98 case _RGB:
99 if (clockwise) {
100 rgblight_increase_sat();
101 } else {
102 rgblight_decrease_sat();
103 }
104 break;
105 case _MACRO:
106 if (clockwise) {
107 break;
108 } else {
109 break;
110 }
111 break;
112 }
113 } else if (index == 2) { /* Third encoder */
114 switch (get_highest_layer(layer_state)) {
115 case _NUMPAD:
116 if (clockwise) {
117 tap_code(KC_VOLU);
118 } else {
119 tap_code(KC_VOLD);
120 }
121 break;
122 case _RGB:
123 if (clockwise) {
124 rgblight_increase_val();
125 } else {
126 rgblight_decrease_val();
127 }
128 break;
129 case _MACRO:
130 if (clockwise) {
131 break;
132 } else {
133 break;
134 }
135 break;
136 }
137 }
138 return true;
139}
140
141layer_state_t layer_state_set_user(layer_state_t state) { //This will run every time the layer is updated
142 switch (get_highest_layer(state)) {
143 case _NUMPAD:
144 setrgb(RGB_WHITE, &led[0]); //Set the top LED to white for the bottom layer
145 setrgb(0, 0, 0, &led[1]);
146 setrgb(0, 0, 0, &led[2]);
147 break;
148 case _RGB:
149 setrgb(0, 0, 0, &led[0]); //Set the middle LED to white for the middle layer
150 setrgb(RGB_WHITE, &led[1]);
151 setrgb(0, 0, 0, &led[2]);
152 break;
153 case _MACRO:
154 setrgb(0, 0, 0, &led[0]);
155 setrgb(0, 0, 0, &led[1]);
156 setrgb(RGB_WHITE, &led[2]); //Set the bottom LED to white for the top layer
157 break;
158 }
159 rgblight_set();
160 return state;
161}
162
163#ifdef OLED_ENABLE
164
165static const char *ANIMATION_NAMES[] = {
166 "unknown",
167 "static",
168 "breathing I",
169 "breathing II",
170 "breathing III",
171 "breathing IV",
172 "rainbow mood I",
173 "rainbow mood II",
174 "rainbow mood III",
175 "rainbow swirl I",
176 "rainbow swirl II",
177 "rainbow swirl III",
178 "rainbow swirl IV",
179 "rainbow swirl V",
180 "rainbow swirl VI",
181 "snake I",
182 "snake II",
183 "snake III",
184 "snake IV",
185 "snake V",
186 "snake VI",
187 "knight I",
188 "knight II",
189 "knight III",
190 "christmas",
191 "static gradient I",
192 "static gradient II",
193 "static gradient III",
194 "static gradient IV",
195 "static gradient V",
196 "static gradient VI",
197 "static gradient VII",
198 "static gradient VIII",
199 "static gradient IX",
200 "static gradient X",
201 "rgb test",
202 "alternating",
203 "twinkle I",
204 "twinkle II",
205 "twinkle III",
206 "twinkle IV",
207 "twinkle V",
208 "twinkle VI"
209};
210
211void rgblight_get_mode_name(uint8_t mode, size_t bufsize, char *buf) {
212 snprintf(buf, bufsize, "%-25s", ANIMATION_NAMES[mode]);
213}
214
215oled_rotation_t oled_init_user(oled_rotation_t rotation) {
216#ifdef LEFT_HAND
217 return OLED_ROTATION_180;
218#else
219 return OLED_ROTATION_0;
220#endif
221}
222
223bool oled_task_user(void) {
224 // Host Keyboard Layer Status
225 oled_write_P(PSTR("Layer: "), false);
226
227 switch (get_highest_layer(layer_state)) {
228 case _NUMPAD:
229 oled_write_P(PSTR("Numpad\n"), false);
230 break;
231 case _RGB:
232 oled_write_P(PSTR("RGB\n"), false);
233 break;
234 case _MACRO:
235 oled_write_P(PSTR("Macro\n"), false);
236 break;
237 default:
238 // Or use the write_ln shortcut over adding '\n' to the end of your string
239 oled_write_ln_P(PSTR("Undefined"), false);
240 }
241
242 static char rgb_mode_name[30];
243 rgblight_get_mode_name(rgblight_get_mode(), sizeof(rgb_mode_name), rgb_mode_name);
244
245 oled_write_P(PSTR("Mode: "), false);
246 oled_write_ln(rgb_mode_name, false);
247 return false;
248}
249#endif
diff --git a/keyboards/dmqdesign/spin/keymaps/gorbachev/readme.md b/keyboards/dmqdesign/spin/keymaps/gorbachev/readme.md
new file mode 100644
index 000000000..451dae7ef
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/gorbachev/readme.md
@@ -0,0 +1,7 @@
1# Keymap for Spin
2
3* Encoder button push changes layers
4* First layer is a number pad
5* Second layer is RGB control layer
6* Third layer is macro layer
7* OLED support
diff --git a/keyboards/dmqdesign/spin/keymaps/gorbachev/rules.mk b/keyboards/dmqdesign/spin/keymaps/gorbachev/rules.mk
new file mode 100644
index 000000000..6af3117b9
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/gorbachev/rules.mk
@@ -0,0 +1,4 @@
1OLED_ENABLE = yes
2OLED_DRIVER = SSD1306
3MOUSEKEY_ENABLE = no
4MIDI_ENABLE = no
diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h
new file mode 100644
index 000000000..1851f07f1
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h
@@ -0,0 +1,42 @@
1/* Copyright 2019-2020 DMQ Design
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#pragma once
18
19#define RGBLIGHT_HUE_STEP 8
20
21// place overrides here
22
23#define NO_ACTION_ONESHOT
24#undef LOCKING_SUPPORT_ENABLE
25
26#define LAYER_STATE_8BIT
27#define MAX_LAYER 4
28
29#undef RGBLIGHT_ANIMATIONS
30#define RGBLIGHT_EFFECT_BREATHING
31#define RGBLIGHT_EFFECT_RAINBOW_MOOD
32#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
33#define RGBLIGHT_EFFECT_SNAKE
34#define RGBLIGHT_EFFECT_KNIGHT
35#define RGBLIGHT_EFFECT_STATIC_GRADIENT
36#define RGBLIGHT_EFFECT_ALTERNATING
37#define RGBLIGHT_EFFECT_TWINKLE
38
39#define RGBLIGHT_SLEEP
40#define RGBLIGHT_LAYERS
41#define RGBLIGHT_LAYER_BLINK
42#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF
diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c
new file mode 100644
index 000000000..bdf5dff0d
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c
@@ -0,0 +1,238 @@
1/* Copyright 2020 Joshua Moses Diamond
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#include QMK_KEYBOARD_H
17
18#include "version.h"
19#include <stdlib.h>
20
21#define RGB_LAYER_ACK_DURATION 500
22
23enum layers { _MACRO, _NUMPAD, _RGB, _FN };
24
25enum layer_base {
26 LAYER_BASE = _MACRO,
27 LAYER_BASE_END = _FN + 1,
28};
29
30enum custom_keycodes {
31 HELLO = SAFE_RANGE,
32 CH_CPNL, // AL Control Panel
33 CH_ASST, // AL Context-aware Desktop Assistant
34 CH_SUSP, // Suspend
35};
36
37// clang-format off
38const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
39 [_MACRO] = LAYOUT(
40 A(S(KC_N)), HELLO, CH_SUSP, TO(_MACRO),
41 KC_MPRV, KC_MPLY, KC_MNXT, TO(_NUMPAD),
42 C(A(KC_COMM)), KC_F5, C(A(KC_DOT)), TO(_RGB),
43 MO(_FN), CH_ASST, CH_CPNL),
44
45 [_NUMPAD] = LAYOUT(
46 KC_KP_7, KC_KP_8, KC_KP_9, KC_TRNS,
47 KC_KP_4, KC_KP_5, KC_KP_6, KC_TRNS,
48 KC_KP_1, KC_KP_2, KC_KP_3, KC_TRNS,
49 KC_KP_0, KC_PDOT, KC_PENT),
50
51 [_RGB] = LAYOUT(
52 RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS,
53 RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS,
54 RGB_SPD, RGB_SPI, KC_NO, KC_TRNS,
55 RGB_RMOD, RGB_TOG, RGB_MOD),
56
57 [_FN] = LAYOUT(
58 KC_TRNS, DEBUG, RESET, KC_TRNS,
59 KC_NO, KC_NO, EEP_RST, KC_TRNS,
60 KC_NO, KC_NO, KC_NO, KC_TRNS,
61 KC_NO, KC_NO, KC_NO),
62};
63// clang-format on
64
65typedef enum layer_ack {
66 ACK_NO = 0,
67 ACK_YES,
68 ACK_MEH,
69} layer_ack_t;
70
71#define LAYER_OFFSET 0
72const rgblight_segment_t PROGMEM _macro_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 1, HSV_TEAL});
73const rgblight_segment_t PROGMEM _numpad_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_TEAL});
74const rgblight_segment_t PROGMEM _rgb_layer[] = RGBLIGHT_LAYER_SEGMENTS({2, 1, HSV_TEAL});
75const rgblight_segment_t PROGMEM _fn_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, HSV_PURPLE});
76
77#define ACK_OFFSET 4
78const rgblight_segment_t PROGMEM _no_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, HSV_RED});
79const rgblight_segment_t PROGMEM _yes_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, HSV_GREEN});
80const rgblight_segment_t PROGMEM _meh_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, HSV_YELLOW});
81
82// clang-format on
83const rgblight_segment_t *const PROGMEM _rgb_layers[] = {
84 [LAYER_OFFSET + 0] = _macro_layer,
85 [LAYER_OFFSET + 1] = _numpad_layer,
86 [LAYER_OFFSET + 2] = _rgb_layer,
87 [LAYER_OFFSET + 3] = _fn_layer,
88
89 [ACK_OFFSET + ACK_NO] = _no_layer,
90 [ACK_OFFSET + ACK_YES] = _yes_layer,
91 [ACK_OFFSET + ACK_MEH] = _meh_layer,
92
93 [ACK_OFFSET + ACK_MEH + 1] = NULL
94};
95// clang-format off
96
97const uint8_t PROGMEM _n_rgb_layers = sizeof(_rgb_layers) / sizeof(_rgb_layers[0]) - 1;
98
99void clear_rgb_layers(void) {
100 dprint("clear_rgb_layers()\n");
101 for (uint8_t i = 0; i < _n_rgb_layers; i++) {
102 rgblight_set_layer_state(i, false);
103 }
104}
105
106void do_rgb_layers(layer_state_t state, uint8_t start, uint8_t end) {
107 dprintf("start=%u, end=%u, LAYER_OFFSET=%u\n", start, end, LAYER_OFFSET);
108 for (uint8_t i = start; i < end; i++) {
109 bool is_on = layer_state_cmp(state, i);
110 uint8_t rl = LAYER_OFFSET + i;
111 dprintf("layer[%u]=%u, rl=%u\n", i, is_on, rl);
112 rgblight_set_layer_state(rl, is_on);
113 }
114}
115
116layer_state_t layer_state_set_user(layer_state_t state) {
117 do_rgb_layers(state, LAYER_BASE, LAYER_BASE_END);
118 return state;
119}
120
121void rgb_layer_ack(layer_ack_t n) {
122 uint8_t layer = ACK_OFFSET + n;
123 dprintf("rgb_layer_ack(%u) ==> %u\n", n, layer);
124 rgblight_blink_layer(layer, RGB_LAYER_ACK_DURATION);
125}
126
127void rgb_layer_ack_yn(bool yn) { rgb_layer_ack(yn ? ACK_YES : ACK_NO); }
128
129void keyboard_post_init_user(void) {
130 // Enable the LED layers
131 rgblight_layers = _rgb_layers;
132 do_rgb_layers(layer_state, LAYER_BASE, LAYER_BASE_END);
133}
134
135void shutdown_user() {
136 clear_rgb_layers();
137 rgblight_enable();
138 rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
139 rgblight_sethsv_noeeprom(HSV_RED);
140}
141
142void spidey_glow(void) {
143 rgblight_enable();
144 rgblight_mode(RGBLIGHT_MODE_RAINBOW_MOOD);
145 rgblight_sethsv(255, 230, 128);
146}
147
148void eeconfig_init_user(void) { spidey_glow(); }
149
150bool process_record_user(uint16_t keycode, keyrecord_t *record) {
151 if (record->event.pressed) {
152 switch (keycode) {
153 // Re-implement this here, but fix the persistence!
154 case DEBUG:
155 if (!debug_enable) {
156 debug_enable = 1;
157 } else if (!debug_keyboard) {
158 debug_keyboard = 1;
159 } else if (!debug_matrix) {
160 debug_matrix = 1;
161 } else {
162 debug_enable = 0;
163 debug_keyboard = 0;
164 debug_matrix = 0;
165 }
166 uprintf("DEBUG: enable=%u, keyboard=%u, matrix=%u\n", debug_enable, debug_keyboard, debug_matrix);
167 uprintln(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE);
168 eeconfig_update_debug(debug_config.raw);
169 return false;
170
171 // clang-format off
172 case CH_CPNL: host_consumer_send(AL_CONTROL_PANEL); return false;
173 case CH_ASST: host_consumer_send(AL_ASSISTANT); return false;
174 case CH_SUSP: tap_code16(LGUI(LSFT(KC_L))); return true;
175 case HELLO: SEND_STRING("Hello, world!"); return true;
176 // clang-format on
177 }
178 } else {
179 switch (keycode) {
180 case CH_CPNL:
181 case CH_ASST:
182 host_consumer_send(0);
183 return false;
184 }
185 }
186
187 return true;
188};
189
190
191void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
192 switch (keycode) {
193 // Acks follow...
194 case DEBUG:
195 rgb_layer_ack_yn(debug_enable);
196 break;
197 case RGB_TOG:
198 rgb_layer_ack_yn(rgblight_is_enabled());
199 break;
200 }
201}
202
203bool encoder_update_user(uint8_t index, bool clockwise) {
204 switch (get_highest_layer(layer_state)) {
205 case _RGB:
206 if (index == 0) {
207 if (clockwise) {
208 rgblight_increase_hue();
209 } else {
210 rgblight_decrease_hue();
211 }
212 } else if (index == 1) {
213 if (clockwise) {
214 rgblight_increase_sat();
215 } else {
216 rgblight_decrease_sat();
217 }
218 } else if (index == 2) {
219 if (clockwise) {
220 rgblight_increase_val();
221 } else {
222 rgblight_decrease_val();
223 }
224 }
225 break;
226
227 default:
228 if (index == 0) {
229 tap_code16(C(S(clockwise ? KC_EQL : KC_MINS)));
230 } else if (index == 1) {
231 tap_code16(C(clockwise ? KC_EQL : KC_MINS));
232 } else if (index == 2) {
233 tap_code(clockwise ? KC_VOLU : KC_VOLD);
234 }
235 break;
236 }
237 return true;
238}
diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/readme.md b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/readme.md
new file mode 100644
index 000000000..1abca2748
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/readme.md
@@ -0,0 +1 @@
spidey3 keymap for spin keypad
diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk
new file mode 100644
index 000000000..7fe1f992a
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk
@@ -0,0 +1,7 @@
1MOUSEKEY_ENABLE = no
2MIDI_ENABLE = no
3BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
4LTO_ENABLE = yes
5CONSOLE_ENABLE = yes # Console for debug
6GRAVE_ESC_ENABLE = no
7
diff --git a/keyboards/dmqdesign/spin/keymaps/via/keymap.c b/keyboards/dmqdesign/spin/keymaps/via/keymap.c
new file mode 100644
index 000000000..6527cc8fd
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/via/keymap.c
@@ -0,0 +1,69 @@
1/* Copyright 2020-2021 adamkraus6
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#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT(
20 KC_7, KC_8, KC_9, TO(0),
21 KC_4, KC_5, KC_6, TO(1),
22 KC_1, KC_2, KC_3, TO(2),
23 KC_0, KC_BSPC, KC_ENTER
24 ),
25
26 [1] = LAYOUT(
27 KC_NO, KC_NO, KC_NO, KC_TRNS,
28 KC_NO, KC_NO, KC_NO, KC_TRNS,
29 KC_NO, KC_NO, KC_NO, KC_TRNS,
30 KC_NO, KC_NO, KC_NO
31 ),
32
33 [2] = LAYOUT(
34 KC_NO, KC_NO, KC_NO, KC_TRNS,
35 KC_NO, KC_NO, KC_NO, KC_TRNS,
36 KC_NO, KC_NO, KC_NO, KC_TRNS,
37 KC_NO, KC_NO, KC_NO
38 ),
39
40 [3] = LAYOUT(
41 KC_NO, KC_NO, KC_NO, KC_TRNS,
42 KC_NO, KC_NO, KC_NO, KC_TRNS,
43 KC_NO, KC_NO, KC_NO, KC_TRNS,
44 KC_NO, KC_NO, KC_NO
45 )
46};
47
48bool encoder_update_user(uint8_t index, bool clockwise) {
49 if (index == 0) { /* First encoder */
50 if (clockwise) {
51 rgblight_increase_hue(); //Cycle through the RGB hue
52 } else {
53 rgblight_decrease_hue();
54 }
55 } else if (index == 1) { /* Second encoder */
56 if (clockwise) {
57 rgblight_increase_sat();
58 } else {
59 rgblight_decrease_sat();
60 }
61 } else if (index == 2) { /* Third encoder */
62 if (clockwise) {
63 rgblight_increase_val(); //Change brightness on the RGB LEDs
64 } else {
65 rgblight_decrease_val();
66 }
67 }
68 return true;
69}
diff --git a/keyboards/dmqdesign/spin/keymaps/via/rules.mk b/keyboards/dmqdesign/spin/keymaps/via/rules.mk
new file mode 100644
index 000000000..1e5b99807
--- /dev/null
+++ b/keyboards/dmqdesign/spin/keymaps/via/rules.mk
@@ -0,0 +1 @@
VIA_ENABLE = yes