diff options
author | HorrorTroll <sonicvipduc@gmail.com> | 2022-02-21 08:18:35 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-20 17:18:35 -0800 |
commit | 3bc8afbb81d2910dbfff45d6c5a26bd54f793697 (patch) | |
tree | 7d8daa08ae8b10bae0bdb9ecb5abc6d6b37605a2 | |
parent | d175ee1d9bc679b501391ad4a8b463d6d9def721 (diff) | |
download | qmk_firmware-3bc8afbb81d2910dbfff45d6c5a26bd54f793697.tar.gz qmk_firmware-3bc8afbb81d2910dbfff45d6c5a26bd54f793697.zip |
Update fix for MW65_rgb and added personal keymap (#15279)
* Update fix for MW65 and added personal keymap
* Resolve fix
* Resolved fix, again
* Added missing GPLv2 license headers
* Resolved issue
23 files changed, 1145 insertions, 47 deletions
diff --git a/keyboards/mwstudio/mw65_rgb/config.h b/keyboards/mwstudio/mw65_rgb/config.h index 8a320664a..d484f7e35 100644 --- a/keyboards/mwstudio/mw65_rgb/config.h +++ b/keyboards/mwstudio/mw65_rgb/config.h | |||
@@ -26,11 +26,11 @@ | |||
26 | #define PRODUCT MW65 | 26 | #define PRODUCT MW65 |
27 | 27 | ||
28 | /* key matrix size */ | 28 | /* key matrix size */ |
29 | #define MATRIX_ROWS 6 | 29 | #define MATRIX_ROWS 5 |
30 | #define MATRIX_COLS 15 | 30 | #define MATRIX_COLS 15 |
31 | 31 | ||
32 | /* key matrix pins */ | 32 | /* key matrix pins */ |
33 | #define MATRIX_ROW_PINS { D0, D1, D2, D3, B7, B0 } | 33 | #define MATRIX_ROW_PINS { D0, D1, D2, D3, B7 } |
34 | #define MATRIX_COL_PINS { C6, B6, B5, B4, D7, D6, D4, C7, F7, F6, F5, F4, F1, F0, E6 } | 34 | #define MATRIX_COL_PINS { C6, B6, B5, B4, D7, D6, D4, C7, F7, F6, F5, F4, F1, F0, E6 } |
35 | 35 | ||
36 | #define BOOTMAGIC_LITE_ROW 0 | 36 | #define BOOTMAGIC_LITE_ROW 0 |
@@ -42,20 +42,59 @@ | |||
42 | /* Set 0 if debouncing isn't needed */ | 42 | /* Set 0 if debouncing isn't needed */ |
43 | #define DEBOUNCE 5 | 43 | #define DEBOUNCE 5 |
44 | 44 | ||
45 | /* Encoder pins */ | ||
46 | #define ENCODERS_PAD_A { B1 } | ||
47 | #define ENCODERS_PAD_B { B2 } | ||
48 | |||
49 | /* RGB Matrix config */ | ||
45 | #define RGB_DI_PIN B3 | 50 | #define RGB_DI_PIN B3 |
46 | #ifdef RGB_DI_PIN | ||
47 | #define RGBLIGHT_SLEEP | ||
48 | 51 | ||
52 | #ifdef RGB_MATRIX_ENABLE | ||
53 | #define DRIVER_LED_TOTAL 83 | ||
49 | #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 | 54 | #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 |
50 | #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS | 55 | #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS |
51 | #define DRIVER_LED_TOTAL 83 | ||
52 | #define RGBLED_NUM 83 | ||
53 | #define RGB_MATRIX_KEYPRESSES | 56 | #define RGB_MATRIX_KEYPRESSES |
54 | 57 | ||
55 | #define RGBLIGHT_HUE_STEP 8 | 58 | /* RGB Matrix effect */ |
56 | #define RGBLIGHT_SAT_STEP 8 | 59 | #define ENABLE_RGB_MATRIX_ALPHAS_MODS |
57 | #define RGBLIGHT_VAL_STEP 8 | 60 | #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN |
58 | #endif | 61 | #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT |
62 | #define ENABLE_RGB_MATRIX_BREATHING | ||
63 | #define ENABLE_RGB_MATRIX_BAND_SAT | ||
64 | #define ENABLE_RGB_MATRIX_BAND_VAL | ||
65 | #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT | ||
66 | #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL | ||
67 | #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT | ||
68 | #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL | ||
69 | #define ENABLE_RGB_MATRIX_CYCLE_ALL | ||
70 | #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
71 | #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
72 | #define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
73 | #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN | ||
74 | #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
75 | #define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL | ||
76 | #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL | ||
77 | #define ENABLE_RGB_MATRIX_DUAL_BEACON | ||
78 | #define ENABLE_RGB_MATRIX_RAINBOW_BEACON | ||
79 | #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
80 | #define ENABLE_RGB_MATRIX_RAINDROPS | ||
81 | #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
82 | #define ENABLE_RGB_MATRIX_HUE_BREATHING | ||
83 | #define ENABLE_RGB_MATRIX_HUE_PENDULUM | ||
84 | #define ENABLE_RGB_MATRIX_HUE_WAVE | ||
85 | #define ENABLE_RGB_MATRIX_PIXEL_RAIN | ||
86 | #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL | ||
59 | 87 | ||
60 | #define ENCODERS_PAD_A { B1 } | 88 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE |
61 | #define ENCODERS_PAD_B { B2 } | 89 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE |
90 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
91 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
92 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
93 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
94 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
95 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
96 | #define ENABLE_RGB_MATRIX_SPLASH | ||
97 | #define ENABLE_RGB_MATRIX_MULTISPLASH | ||
98 | #define ENABLE_RGB_MATRIX_SOLID_SPLASH | ||
99 | #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
100 | #endif | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c b/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c index 7028a223c..ba043525e 100644 --- a/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c +++ b/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include QMK_KEYBOARD_H | 17 | #include QMK_KEYBOARD_H |
18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
19 | 19 | ||
20 | [0] = LAYOUT( | 20 | [0] = LAYOUT_65_ansi_blocker( |
21 | KC_ESC, 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_VOLD, KC_DEL, KC_VOLU, | 21 | KC_ESC, 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_VOLD, KC_DEL, KC_VOLU, |
22 | 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, | 22 | 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, |
23 | 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, | 23 | 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, |
@@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
25 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT | 25 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT |
26 | ), | 26 | ), |
27 | 27 | ||
28 | [1] = LAYOUT( | 28 | [1] = LAYOUT_65_ansi_blocker( |
29 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_HUI, _______, | 29 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_HUI, _______, |
30 | RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, | 30 | RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, |
31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, | 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, |
@@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
33 | _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI | 33 | _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI |
34 | ), | 34 | ), |
35 | 35 | ||
36 | [2] = LAYOUT( | 36 | [2] = LAYOUT_65_ansi_blocker( |
37 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 37 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
@@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
41 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | 41 | _______, _______, _______, _______, _______, _______, _______, _______, _______ |
42 | ), | 42 | ), |
43 | 43 | ||
44 | [3] = LAYOUT( | 44 | [3] = LAYOUT_65_ansi_blocker( |
45 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 45 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
46 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 46 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
47 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 47 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/config.h b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/config.h new file mode 100644 index 000000000..13cffea4d --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/config.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 DYNAMIC_KEYMAP_LAYER_COUNT 3 | ||
20 | |||
21 | /* Forcing to use NKRO instead 6KRO */ | ||
22 | #define FORCE_NKRO | ||
23 | |||
24 | /* Change USB Polling Rate to 1000hz and a larger keys per scan for elite gaming */ | ||
25 | #define USB_POLLING_INTERVAL_MS 1 | ||
26 | #define QMK_KEYS_PER_SCAN 12 | ||
27 | |||
28 | #ifdef RGB_MATRIX_ENABLE | ||
29 | /* RGB Matrix config */ | ||
30 | #undef ENABLE_RGB_MATRIX_BAND_SAT | ||
31 | #undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT | ||
32 | #undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT | ||
33 | #undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL | ||
34 | |||
35 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
36 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
37 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
38 | #undef ENABLE_RGB_MATRIX_SPLASH | ||
39 | #undef ENABLE_RGB_MATRIX_SOLID_SPLASH | ||
40 | #endif | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap.c b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap.c new file mode 100644 index 000000000..2ca315258 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap.c | |||
@@ -0,0 +1,103 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 | #include "keymap_stuff.h" | ||
20 | |||
21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
22 | |||
23 | /* | ||
24 | VolD ◯ VolU | ||
25 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ | ||
26 | │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Bckspc│Hom│ | ||
27 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ | ||
28 | │ Tab │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ [ │ ] │ \ │End│ | ||
29 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ | ||
30 | │ Caps │ a │ s │ d │ f │ g │ h │ j │ k │ l │ ; │ ' │ Enter │PgU│ | ||
31 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ | ||
32 | │ LShift │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ RSft │ ↑ │PgD│ | ||
33 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ | ||
34 | │LCrl│GUI │LAlt│ Space │RAlt│ Fn │ │ ← │ ↓ │ → │ | ||
35 | └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ | ||
36 | ◯ | ||
37 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ | ||
38 | │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ │ | ||
39 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ | ||
40 | │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ { │ } │ | │ │ | ||
41 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ | ||
42 | │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ : │ " │ │ │ | ||
43 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ | ||
44 | │ LShift │ Z │ X │ C │ V │ B │ N │ M │ < │ > │ ? │ RSht │ │ │ | ||
45 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ | ||
46 | │ │ │ │ │ │ │ │ │ │ │ | ||
47 | └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ | ||
48 | */ | ||
49 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ | ||
50 | [_BASE] = LAYOUT( | ||
51 | KC_ESC, 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_VOLD, KC_HOME, KC_VOLU, | ||
52 | 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_END, | ||
53 | 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_PGUP, | ||
54 | 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_PGDN, | ||
55 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT | ||
56 | ), | ||
57 | |||
58 | /* | ||
59 | ◯ | ||
60 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ | ||
61 | │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Home │ │ | ||
62 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ | ||
63 | │ │ │ │ │ │ │ │ │ │ │ │ │ │Pause│Ins│ | ||
64 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ | ||
65 | │ │ │ │ │ │ │ │ │ │ │ │ │ PrtSc │Del│ | ||
66 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ | ||
67 | │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ | ||
68 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ | ||
69 | │ │ │ │ │ Fn │ │ │ │ │ │ | ||
70 | └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ | ||
71 | */ | ||
72 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ | ||
73 | [_FN] = LAYOUT( | ||
74 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, _______, _______, _______, | ||
75 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUSE, KC_INS, | ||
76 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_DEL, | ||
77 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
78 | _______, _______, _______, _______, _______, MO(_RN), _______, _______, _______ | ||
79 | ), | ||
80 | |||
81 | /* | ||
82 | ◯ | ||
83 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ | ||
84 | │Rst│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ | ||
85 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ | ||
86 | │ │1Hd│1Hi│1Sd│1Si│1Vd│1Vi│ │Hud│Hui│ │C_E│ │ │Tog│ | ||
87 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ | ||
88 | │ │2Hd│2Hi│2Sd│2Si│2Vd│2Vi│ │Sad│Sai│ │ │ │ │ | ||
89 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ | ||
90 | │ │Pre│Ref│Flp│ │ │ │Spd│Spi│ │ │ │Vai│ │ | ||
91 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ | ||
92 | │ │ │ │ │ │ Rn │ │Rod│Vad│Mod│ | ||
93 | └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ | ||
94 | */ | ||
95 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ | ||
96 | [_RN] = LAYOUT( | ||
97 | RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
98 | _______, G1_HUD, G1_HUI, G1_SAD, G1_SAI, G1_VAD, G1_VAI, _______, RGB_HUD, RGB_HUI, _______, RGB_C_E, _______, _______, RGB_TOG, | ||
99 | _______, G2_HUD, G2_HUI, G2_SAD, G2_SAI, G2_VAD, G2_VAI, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, | ||
100 | _______, G_PRE, REF_G, G_FLIP, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, RGB_VAI, _______, | ||
101 | _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD | ||
102 | ), | ||
103 | }; | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap_stuff.h b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap_stuff.h new file mode 100644 index 000000000..c8b801536 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap_stuff.h | |||
@@ -0,0 +1,335 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 <string.h> | ||
18 | #include <math.h> | ||
19 | |||
20 | #include <lib/lib8tion/lib8tion.h> | ||
21 | |||
22 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
23 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
24 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
25 | // entirely and just use numbers. | ||
26 | |||
27 | enum layer_names { | ||
28 | _BASE = 0, | ||
29 | _FN = 1, | ||
30 | _RN = 2 | ||
31 | }; | ||
32 | |||
33 | // For CUSTOM_GRADIENT | ||
34 | HSV gradient_0 = {205, 250, 255}; | ||
35 | HSV gradient_100 = {140, 215, 125}; | ||
36 | bool reflected_gradient = false; | ||
37 | uint8_t gp_i = 0; | ||
38 | |||
39 | typedef struct { | ||
40 | HSV gradient_0; | ||
41 | HSV gradient_1; | ||
42 | bool reflected; | ||
43 | } CUSTOM_PRESETS; | ||
44 | |||
45 | enum user_rgb_mode { | ||
46 | RGB_MODE_ALL, | ||
47 | RGB_MODE_KEYLIGHT, | ||
48 | RGB_MODE_UNDERGLOW, | ||
49 | RGB_MODE_NONE, | ||
50 | }; | ||
51 | |||
52 | typedef union { | ||
53 | uint32_t raw; | ||
54 | struct { | ||
55 | uint8_t rgb_mode :8; | ||
56 | }; | ||
57 | } user_config_t; | ||
58 | |||
59 | user_config_t user_config; | ||
60 | |||
61 | enum layer_keycodes { | ||
62 | //Custom Gradient control keycode | ||
63 | G1_HUI = SAFE_RANGE, //Custom gradient color 1 hue increase | ||
64 | G1_HUD, //Custom gradient color 1 hue decrease | ||
65 | G1_SAI, //Custom gradient color 1 saturation increase | ||
66 | G1_SAD, //Custom gradient color 1 saturation decrease | ||
67 | G1_VAI, //Custom gradient color 1 value increase | ||
68 | G1_VAD, //Custom gradient color 1 value decrease | ||
69 | G2_HUI, //Custom gradient color 2 hue increase | ||
70 | G2_HUD, //Custom gradient color 2 hue decrease | ||
71 | G2_SAI, //Custom gradient color 2 saturation increase | ||
72 | G2_SAD, //Custom gradient color 2 saturation decrease | ||
73 | G2_VAI, //Custom gradient color 2 value increase | ||
74 | G2_VAD, //Custom gradient color 2 value decrease | ||
75 | G_PRE, //Gradient presets | ||
76 | REF_G, //Toggle between linear and reflected gradient | ||
77 | G_FLIP, //Flip the gradient colors | ||
78 | |||
79 | //Custom led effect keycode | ||
80 | RGB_C_E, //Cycle user effect | ||
81 | }; | ||
82 | |||
83 | void keyboard_post_init_kb(void) { | ||
84 | user_config.raw = eeconfig_read_user(); | ||
85 | switch (user_config.rgb_mode) { | ||
86 | case RGB_MODE_ALL: | ||
87 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
88 | rgb_matrix_enable_noeeprom(); | ||
89 | break; | ||
90 | case RGB_MODE_KEYLIGHT: | ||
91 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); | ||
92 | rgb_matrix_set_color_all(0, 0, 0); | ||
93 | break; | ||
94 | case RGB_MODE_UNDERGLOW: | ||
95 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
96 | rgb_matrix_set_color_all(0, 0, 0); | ||
97 | break; | ||
98 | case RGB_MODE_NONE: | ||
99 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
100 | rgb_matrix_set_color_all(0, 0, 0); | ||
101 | break; | ||
102 | } | ||
103 | } | ||
104 | |||
105 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
106 | uint8_t color_adj_step = 5; | ||
107 | |||
108 | CUSTOM_PRESETS gradient_presets[] = { | ||
109 | {{41 , 255, 255}, {233, 245, 255}, false }, | ||
110 | {{45 , 245, 155}, {160, 255, 80}, false }, | ||
111 | {{173, 245, 40}, {41 , 255, 205}, true }, | ||
112 | {{32 , 255, 165}, {217, 185, 70}, false }, | ||
113 | {{240, 255, 145}, {115, 255, 245}, true }, | ||
114 | {{118, 255, 255}, {242, 255, 255}, false }, | ||
115 | {{212, 0 , 0}, {223, 235, 165}, true }, | ||
116 | {{205, 250, 255}, {140, 215, 125}, false }, | ||
117 | }; | ||
118 | |||
119 | uint8_t gp_length = sizeof(gradient_presets)/sizeof(gradient_presets[0]); | ||
120 | |||
121 | switch (keycode) { | ||
122 | case G1_HUI: | ||
123 | if (record->event.pressed) { | ||
124 | gradient_0.h += color_adj_step; | ||
125 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
126 | } | ||
127 | return false; | ||
128 | case G1_HUD: | ||
129 | if (record->event.pressed) { | ||
130 | gradient_0.h -= color_adj_step; | ||
131 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
132 | } | ||
133 | return false; | ||
134 | case G1_SAI: | ||
135 | if (record->event.pressed) { | ||
136 | gradient_0.s = (gradient_0.s + color_adj_step * 2 <= 255) ? gradient_0.s + color_adj_step * 2 : 255; | ||
137 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
138 | } | ||
139 | return false; | ||
140 | case G1_SAD: | ||
141 | if (record->event.pressed) { | ||
142 | gradient_0.s = (gradient_0.s - color_adj_step * 2 >= 0) ? gradient_0.s - color_adj_step * 2 : 0; | ||
143 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
144 | } | ||
145 | return false; | ||
146 | case G1_VAI: | ||
147 | if (record->event.pressed) { | ||
148 | gradient_0.v = (gradient_0.v + color_adj_step * 2 <= 255) ? gradient_0.v + color_adj_step * 2 : 255; | ||
149 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
150 | } | ||
151 | return false; | ||
152 | case G1_VAD: | ||
153 | if (record->event.pressed) { | ||
154 | gradient_0.v = (gradient_0.v - color_adj_step * 2 >= 0) ? gradient_0.v - color_adj_step * 2 : 0; | ||
155 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
156 | } | ||
157 | return false; | ||
158 | case G2_HUI: | ||
159 | if (record->event.pressed) { | ||
160 | gradient_100.h += color_adj_step; | ||
161 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
162 | } | ||
163 | return false; | ||
164 | case G2_HUD: | ||
165 | if (record->event.pressed) { | ||
166 | gradient_100.h -= color_adj_step; | ||
167 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
168 | } | ||
169 | return false; | ||
170 | case G2_SAI: | ||
171 | if (record->event.pressed) { | ||
172 | gradient_100.s = (gradient_100.s + color_adj_step * 2 <= 255) ? gradient_100.s + color_adj_step * 2 : 255; | ||
173 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
174 | } | ||
175 | return false; | ||
176 | case G2_SAD: | ||
177 | if (record->event.pressed) { | ||
178 | gradient_100.s = (gradient_100.s - color_adj_step * 2 >= 0) ? gradient_100.s - color_adj_step * 2 : 0; | ||
179 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
180 | } | ||
181 | return false; | ||
182 | case G2_VAI: | ||
183 | if (record->event.pressed) { | ||
184 | gradient_100.v = (gradient_100.v + color_adj_step * 2 <= 255) ? gradient_100.v + color_adj_step * 2 : 255; | ||
185 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
186 | } | ||
187 | return false; | ||
188 | case G2_VAD: | ||
189 | if (record->event.pressed) { | ||
190 | gradient_100.v = (gradient_100.v - color_adj_step * 2 >= 0) ? gradient_100.v - color_adj_step * 2 : 0; | ||
191 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
192 | } | ||
193 | return false; | ||
194 | case G_PRE: | ||
195 | if (record->event.pressed) { | ||
196 | gp_i = (gp_i + gp_length ) % gp_length; | ||
197 | |||
198 | gradient_0 = gradient_presets[gp_i].gradient_0; | ||
199 | gradient_100 = gradient_presets[gp_i].gradient_1; | ||
200 | reflected_gradient = gradient_presets[gp_i].reflected; | ||
201 | |||
202 | gp_i += 1; | ||
203 | } | ||
204 | return false; | ||
205 | case REF_G: | ||
206 | if (record->event.pressed) { | ||
207 | reflected_gradient = !reflected_gradient; | ||
208 | } | ||
209 | return false; | ||
210 | case G_FLIP: | ||
211 | if (record->event.pressed) { | ||
212 | HSV temp_color = gradient_0; | ||
213 | gradient_0 = gradient_100; | ||
214 | gradient_100 = temp_color; | ||
215 | } | ||
216 | return false; | ||
217 | case RGB_C_E: | ||
218 | if (record->event.pressed) { | ||
219 | switch (rgb_matrix_get_mode()) { | ||
220 | case RGB_MATRIX_CUSTOM_CUSTOM_GRADIENT: | ||
221 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_DIAGONAL); | ||
222 | return false; | ||
223 | case RGB_MATRIX_CUSTOM_DIAGONAL: | ||
224 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_COOL_DIAGONAL); | ||
225 | return false; | ||
226 | case RGB_MATRIX_CUSTOM_COOL_DIAGONAL: | ||
227 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_RAINBOW_REACTIVE_SIMPLE); | ||
228 | return false; | ||
229 | case RGB_MATRIX_CUSTOM_RAINBOW_REACTIVE_SIMPLE: | ||
230 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_KITT); | ||
231 | return false; | ||
232 | case RGB_MATRIX_CUSTOM_KITT: | ||
233 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_RANDOM_BREATH_RAINBOW); | ||
234 | return false; | ||
235 | default: | ||
236 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_CUSTOM_GRADIENT); | ||
237 | return false; | ||
238 | } | ||
239 | } | ||
240 | return false; | ||
241 | case RGB_TOG: | ||
242 | if (record->event.pressed) { | ||
243 | switch (rgb_matrix_get_flags()) { | ||
244 | case LED_FLAG_ALL: { | ||
245 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
246 | rgb_matrix_set_color_all(0, 0, 0); | ||
247 | user_config.rgb_mode = RGB_MODE_KEYLIGHT; | ||
248 | } | ||
249 | break; | ||
250 | case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { | ||
251 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
252 | rgb_matrix_set_color_all(0, 0, 0); | ||
253 | user_config.rgb_mode = RGB_MODE_UNDERGLOW; | ||
254 | } | ||
255 | break; | ||
256 | case (LED_FLAG_UNDERGLOW): { | ||
257 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
258 | rgb_matrix_set_color_all(0, 0, 0); | ||
259 | user_config.rgb_mode = RGB_MODE_NONE; | ||
260 | } | ||
261 | break; | ||
262 | default: { | ||
263 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
264 | rgb_matrix_enable_noeeprom(); | ||
265 | user_config.rgb_mode = RGB_MODE_ALL; | ||
266 | } | ||
267 | break; | ||
268 | } | ||
269 | eeconfig_update_user(user_config.raw); | ||
270 | } | ||
271 | return false; | ||
272 | } | ||
273 | return true; | ||
274 | } | ||
275 | |||
276 | #ifdef ENCODER_ENABLE | ||
277 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
278 | if (index == 0) { | ||
279 | if (clockwise) { | ||
280 | tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 3)); | ||
281 | } else { | ||
282 | tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 4)); | ||
283 | } | ||
284 | } | ||
285 | return true; | ||
286 | } | ||
287 | #endif | ||
288 | |||
289 | void rgb_matrix_indicators_user(void) { | ||
290 | switch (biton32(layer_state)) { | ||
291 | case _FN: | ||
292 | rgb_matrix_set_color(16, 0, 0, 0); rgb_matrix_set_color(17, 0, 0, 0); rgb_matrix_set_color(18, 0, 0, 0); rgb_matrix_set_color(21, 0, 0, 0); | ||
293 | rgb_matrix_set_color(22, 0, 0, 0); rgb_matrix_set_color(23, 0, 0, 0); rgb_matrix_set_color(24, 0, 0, 0); rgb_matrix_set_color(25, 0, 0, 0); | ||
294 | rgb_matrix_set_color(26, 0, 0, 0); rgb_matrix_set_color(27, 0, 0, 0); rgb_matrix_set_color(28, 0, 0, 0); rgb_matrix_set_color(29, 0, 0, 0); | ||
295 | rgb_matrix_set_color(30, 0, 0, 0); rgb_matrix_set_color(31, 0, 0, 0); rgb_matrix_set_color(32, 0, 0, 0); rgb_matrix_set_color(33, 0, 0, 0); | ||
296 | rgb_matrix_set_color(34, 0, 0, 0); rgb_matrix_set_color(35, 0, 0, 0); rgb_matrix_set_color(36, 0, 0, 0); rgb_matrix_set_color(37, 0, 0, 0); | ||
297 | rgb_matrix_set_color(38, 0, 0, 0); rgb_matrix_set_color(41, 0, 0, 0); rgb_matrix_set_color(42, 0, 0, 0); rgb_matrix_set_color(43, 0, 0, 0); | ||
298 | rgb_matrix_set_color(44, 0, 0, 0); rgb_matrix_set_color(45, 0, 0, 0); rgb_matrix_set_color(46, 0, 0, 0); rgb_matrix_set_color(47, 0, 0, 0); | ||
299 | rgb_matrix_set_color(48, 0, 0, 0); rgb_matrix_set_color(49, 0, 0, 0); rgb_matrix_set_color(50, 0, 0, 0); rgb_matrix_set_color(51, 0, 0, 0); | ||
300 | rgb_matrix_set_color(52, 0, 0, 0); rgb_matrix_set_color(53, 0, 0, 0); rgb_matrix_set_color(54, 0, 0, 0); rgb_matrix_set_color(55, 0, 0, 0); | ||
301 | rgb_matrix_set_color(56, 0, 0, 0); rgb_matrix_set_color(57, 0, 0, 0); rgb_matrix_set_color(58, 0, 0, 0); rgb_matrix_set_color(59, 0, 0, 0); | ||
302 | rgb_matrix_set_color(60, 0, 0, 0); rgb_matrix_set_color(61, 0, 0, 0); rgb_matrix_set_color(62, 0, 0, 0); rgb_matrix_set_color(63, 0, 0, 0); | ||
303 | rgb_matrix_set_color(64, 0, 0, 0); rgb_matrix_set_color(65, 0, 0, 0); rgb_matrix_set_color(68, 0, 0, 0); | ||
304 | break; | ||
305 | case _RN: | ||
306 | rgb_matrix_set_color(20, 0, 0, 0); rgb_matrix_set_color(21, 0, 0, 0); rgb_matrix_set_color(22, 0, 0, 0); rgb_matrix_set_color(23, 0, 0, 0); | ||
307 | rgb_matrix_set_color(24, 0, 0, 0); rgb_matrix_set_color(25, 0, 0, 0); rgb_matrix_set_color(29, 0, 0, 0); rgb_matrix_set_color(30, 0, 0, 0); | ||
308 | rgb_matrix_set_color(31, 0, 0, 0); rgb_matrix_set_color(34, 0, 0, 0); rgb_matrix_set_color(35, 0, 0, 0); rgb_matrix_set_color(36, 0, 0, 0); | ||
309 | rgb_matrix_set_color(38, 0, 0, 0); rgb_matrix_set_color(39, 0, 0, 0); rgb_matrix_set_color(40, 0, 0, 0); rgb_matrix_set_color(41, 0, 0, 0); | ||
310 | rgb_matrix_set_color(42, 0, 0, 0); rgb_matrix_set_color(45, 0, 0, 0); rgb_matrix_set_color(52, 0, 0, 0); rgb_matrix_set_color(53, 0, 0, 0); | ||
311 | rgb_matrix_set_color(60, 0, 0, 0); rgb_matrix_set_color(63, 0, 0, 0); rgb_matrix_set_color(65, 0, 0, 0); rgb_matrix_set_color(66, 0, 0, 0); | ||
312 | rgb_matrix_set_color(68, 0, 0, 0); rgb_matrix_set_color(69, 0, 0, 0); rgb_matrix_set_color(70, 0, 0, 0); rgb_matrix_set_color(71, 0, 0, 0); | ||
313 | rgb_matrix_set_color(72, 0, 0, 0); rgb_matrix_set_color(73, 0, 0, 0); rgb_matrix_set_color(74, 0, 0, 0); rgb_matrix_set_color(75, 0, 0, 0); | ||
314 | rgb_matrix_set_color(76, 0, 0, 0); rgb_matrix_set_color(77, 0, 0, 0); rgb_matrix_set_color(78, 0, 0, 0); rgb_matrix_set_color(79, 0, 0, 0); | ||
315 | rgb_matrix_set_color(80, 0, 0, 0); rgb_matrix_set_color(81, 0, 0, 0); | ||
316 | break; | ||
317 | } | ||
318 | |||
319 | HSV hsv = rgb_matrix_config.hsv; | ||
320 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
321 | hsv.h = time; | ||
322 | RGB rgb = hsv_to_rgb(hsv); | ||
323 | |||
324 | if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) { | ||
325 | if (host_keyboard_led_state().caps_lock) { | ||
326 | rgb_matrix_set_color(52, rgb.r, rgb.g, rgb.b); | ||
327 | } | ||
328 | } else { | ||
329 | if (host_keyboard_led_state().caps_lock) { | ||
330 | rgb_matrix_set_color(52, rgb.r, rgb.g, rgb.b); | ||
331 | } else { | ||
332 | rgb_matrix_set_color(52, 0, 0, 0); | ||
333 | } | ||
334 | } | ||
335 | } | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/cool_diagonal.c b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/cool_diagonal.c new file mode 100644 index 000000000..367b3d572 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/cool_diagonal.c | |||
@@ -0,0 +1,22 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 | static HSV COOL_DIAGONAL_math(HSV hsv, uint8_t i, uint8_t time) { | ||
18 | hsv.h = (g_led_config.point[i].x / 4) - g_led_config.point[i].y - time; | ||
19 | return hsv; | ||
20 | } | ||
21 | |||
22 | bool COOL_DIAGONAL(effect_params_t* params) { return effect_runner_i(params, &COOL_DIAGONAL_math); } | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/custom_gradient.c b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/custom_gradient.c new file mode 100644 index 000000000..49e4a242f --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/custom_gradient.c | |||
@@ -0,0 +1,74 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 | extern HSV gradient_0; | ||
18 | extern HSV gradient_100; | ||
19 | extern bool reflected_gradient; | ||
20 | |||
21 | static HSV INTERPOLATE_HSV(float step, HSV gradient_0, HSV gradient_100) { | ||
22 | uint8_t cw, ccw; | ||
23 | HSV color; | ||
24 | |||
25 | cw = (gradient_0.h >= gradient_100.h) ? 255 + gradient_100.h - gradient_0.h : gradient_100.h - gradient_0.h; // Hue range is 0 to 255. | ||
26 | ccw = (gradient_0.h >= gradient_100.h) ? gradient_0.h - gradient_100.h : 255 + gradient_0.h - gradient_100.h; | ||
27 | |||
28 | if( cw < ccw ) { // going clockwise | ||
29 | color.h = gradient_0.h + (uint8_t)(step * cw); | ||
30 | } else { // Going counter clockwise | ||
31 | color.h = gradient_0.h - (uint8_t)(step * ccw); | ||
32 | } | ||
33 | |||
34 | color.s = gradient_0.s + step * (gradient_100.s - gradient_0.s); | ||
35 | |||
36 | // Scale V with global RGB Matrix's V, so users can still control overall brightness with RGB_VAI & RGB_VAD0 | ||
37 | color.v = round((gradient_0.v + step * (gradient_100.v - gradient_0.v)) * ((float)rgb_matrix_config.hsv.v / 255)); | ||
38 | |||
39 | return color; | ||
40 | } | ||
41 | |||
42 | static HSV CUSTOM_GRADIENT_math(uint8_t led_x, uint8_t min_x, uint8_t max_x) { | ||
43 | float step = (float)led_x / (max_x - min_x); | ||
44 | float mid_gradient_pos = 0.5; | ||
45 | |||
46 | if( reflected_gradient ) { | ||
47 | if( step <= mid_gradient_pos ) { | ||
48 | return INTERPOLATE_HSV(step * (1/mid_gradient_pos), gradient_0, gradient_100); | ||
49 | } else { | ||
50 | return INTERPOLATE_HSV((step - mid_gradient_pos) * (1/(1-mid_gradient_pos)), gradient_100, gradient_0); | ||
51 | } | ||
52 | |||
53 | } else { | ||
54 | return INTERPOLATE_HSV(step, gradient_0, gradient_100); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | static bool CUSTOM_GRADIENT(effect_params_t* params) { | ||
59 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
60 | |||
61 | uint8_t min_x = 0; // X coordinate of the left-most LED | ||
62 | uint8_t max_x = 224; // X coordinate of the right-most LED | ||
63 | |||
64 | for (uint8_t i = led_min; i < led_max; i++) { | ||
65 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
66 | |||
67 | HSV hsv_orig = CUSTOM_GRADIENT_math(g_led_config.point[i].x, min_x, max_x); | ||
68 | RGB rgb = hsv_to_rgb(hsv_orig); | ||
69 | |||
70 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
71 | } | ||
72 | |||
73 | return led_max < DRIVER_LED_TOTAL; | ||
74 | } | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/diagonal.c b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/diagonal.c new file mode 100644 index 000000000..19e3791bd --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/diagonal.c | |||
@@ -0,0 +1,22 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 | static HSV DIAGONAL_math(HSV hsv, uint8_t i, uint8_t time) { | ||
18 | hsv.h = g_led_config.point[i].x - g_led_config.point[i].y - time; | ||
19 | return hsv; | ||
20 | } | ||
21 | |||
22 | bool DIAGONAL(effect_params_t* params) { return effect_runner_i(params, &DIAGONAL_math); } | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/kitt.c b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/kitt.c new file mode 100644 index 000000000..7f45cc23e --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/kitt.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 | // variable for startup animation | ||
18 | bool BASE_EFFECT_NOT_STARTED_YET = true; | ||
19 | uint8_t base_effect_startup_counter = 255; | ||
20 | |||
21 | uint8_t led_count = 10; | ||
22 | uint8_t led_first = 41; | ||
23 | |||
24 | static uint8_t time_to_led(uint8_t time, uint8_t led_behind) { | ||
25 | uint16_t led_time = led_count * time; | ||
26 | uint16_t step = ((2 * led_count + (led_time / 128)) - led_behind) % (2 * led_count); | ||
27 | uint8_t led; | ||
28 | |||
29 | if (step < led_count) { | ||
30 | led = step; | ||
31 | } else { | ||
32 | led = led_count - 1 - (step - led_count); | ||
33 | } | ||
34 | |||
35 | return led; | ||
36 | } | ||
37 | |||
38 | static HSV KITT_math(HSV hsv, uint8_t i, uint8_t time) { | ||
39 | |||
40 | // reset base effect startup | ||
41 | if (i == 0) { | ||
42 | BASE_EFFECT_NOT_STARTED_YET = true; | ||
43 | } | ||
44 | |||
45 | hsv.h = 0; | ||
46 | hsv.s = 255; | ||
47 | |||
48 | if (i >= led_first && i < led_first + led_count) { | ||
49 | uint8_t j = i - led_first; | ||
50 | if (j == time_to_led(time, 0)) { | ||
51 | hsv.v = hsv.v; | ||
52 | } else if (j == time_to_led(time, 1)) { | ||
53 | hsv.v = hsv.v/2; | ||
54 | } else if (j == time_to_led(time, 2)) { | ||
55 | hsv.v = hsv.v/4; | ||
56 | } else if (j == time_to_led(time, 3)) { | ||
57 | hsv.v = hsv.v/8; | ||
58 | } else { | ||
59 | hsv.v = 0; | ||
60 | } | ||
61 | } else { | ||
62 | hsv.v = 0; | ||
63 | } | ||
64 | |||
65 | return hsv; | ||
66 | } | ||
67 | |||
68 | bool KITT(effect_params_t* params) { return effect_runner_i(params, &KITT_math); } | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.c b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.c new file mode 100644 index 000000000..ae3398872 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 "led/rainbow_reactive_simple/rainbow_reactive_simple.h" | ||
18 | |||
19 | static HSV RAINBOW_REACTIVE_SIMPLE_math(HSV hsv, uint8_t i, uint8_t time, uint16_t offset) { | ||
20 | hsv.h = g_led_config.point[i].x - time; | ||
21 | hsv.v = scale8(255 - offset, hsv.v); | ||
22 | return hsv; | ||
23 | } | ||
24 | |||
25 | bool RAINBOW_REACTIVE_SIMPLE(effect_params_t* params) { return effect_rainbow_reactive(params, &RAINBOW_REACTIVE_SIMPLE_math); } | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.h b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.h new file mode 100644 index 000000000..56b204e0a --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 | typedef HSV (*rainbow_reactive_f)(HSV hsv, uint8_t i, uint8_t time, uint16_t offset); | ||
20 | |||
21 | bool effect_rainbow_reactive(effect_params_t* params, rainbow_reactive_f effect_func) { | ||
22 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
23 | |||
24 | uint8_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 4); | ||
25 | uint16_t max_tick = 65535 / rgb_matrix_config.speed; | ||
26 | |||
27 | for (uint8_t i = led_min; i < led_max; i++) { | ||
28 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
29 | uint16_t tick = max_tick; | ||
30 | |||
31 | // Reverse search to find most recent key hit | ||
32 | for (int8_t j = g_last_hit_tracker.count - 1; j >= 0; j--) { | ||
33 | if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { | ||
34 | tick = g_last_hit_tracker.tick[j]; | ||
35 | break; | ||
36 | } | ||
37 | } | ||
38 | |||
39 | uint16_t offset = scale16by8(tick, rgb_matrix_config.speed); | ||
40 | RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time, offset)); | ||
41 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
42 | } | ||
43 | |||
44 | return led_max < DRIVER_LED_TOTAL; | ||
45 | } | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/random_breath_rainbow.c b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/random_breath_rainbow.c new file mode 100644 index 000000000..041417477 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/led/random_breath_rainbow.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
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 | static uint8_t offset[DRIVER_LED_TOTAL]; | ||
18 | |||
19 | static void doRandom_breath_rainbow(int i, effect_params_t* params) { | ||
20 | if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; | ||
21 | uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 6); | ||
22 | |||
23 | if (rand() * 50 == 1) { | ||
24 | if (rand() * 2 == 1) { | ||
25 | offset[i]++; | ||
26 | } | ||
27 | else { | ||
28 | offset[i]--; | ||
29 | } | ||
30 | } | ||
31 | |||
32 | //float val = (((float)sin8(time + offset[i]) / 256)/2.1) + .05; | ||
33 | HSV hsv = {0, 255, 255}; | ||
34 | hsv.h = scale16by8(g_rgb_timer + offset[i], rgb_matrix_config.speed / 4) + (offset[i]*2); | ||
35 | hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); | ||
36 | RGB rgb = rgb_matrix_hsv_to_rgb(hsv); | ||
37 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
38 | } | ||
39 | |||
40 | bool RANDOM_BREATH_RAINBOW(effect_params_t* params) { | ||
41 | |||
42 | if (!params->init) { | ||
43 | // Change one LED every tick, make sure speed is not 0 | ||
44 | doRandom_breath_rainbow(rand() % DRIVER_LED_TOTAL, params); | ||
45 | return false; | ||
46 | } | ||
47 | |||
48 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
49 | |||
50 | for (uint8_t i = led_min; i < led_max; i++) { | ||
51 | doRandom_breath_rainbow(i, params); | ||
52 | } | ||
53 | |||
54 | return led_max < DRIVER_LED_TOTAL; | ||
55 | } | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/readme.md b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/readme.md new file mode 100644 index 000000000..2341d818e --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/readme.md | |||
@@ -0,0 +1,11 @@ | |||
1 | # My personal keymap with VIA and custom LED effect | ||
2 | |||
3 | Keymap is default 67 qwerty, 65 ansi blocker layout | ||
4 | |||
5 | It have new LED effect: | ||
6 | |||
7 | - Custom gradient (ported from SirTimmyTimbit code [https://github.com/SirTimmyTimbit/customizable-gradient-effect-for-drop-alt]) | ||
8 | - Diagonal (ported from pleasuretek code [https://github.com/pleasuretek/qmk_firmware]) | ||
9 | - Rainbow reactive simple | ||
10 | - Knight Rider (ported from jumper149 code [https://github.com/jumper149/qmk_firmware/blob/jumper149/keyboards/dztech/dz65rgb/keymaps/jumper149/]) | ||
11 | - Random breath rainbow (based from daed code [https://github.com/daed/qmk_firmware/blob/master/keyboards/massdrop/alt/keymaps/daed] and modify by me) | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/rgb_matrix_user.inc b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/rgb_matrix_user.inc new file mode 100644 index 000000000..ea742af2d --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/rgb_matrix_user.inc | |||
@@ -0,0 +1,17 @@ | |||
1 | RGB_MATRIX_EFFECT(CUSTOM_GRADIENT) | ||
2 | RGB_MATRIX_EFFECT(DIAGONAL) | ||
3 | RGB_MATRIX_EFFECT(COOL_DIAGONAL) | ||
4 | RGB_MATRIX_EFFECT(RAINBOW_REACTIVE_SIMPLE) | ||
5 | RGB_MATRIX_EFFECT(KITT) | ||
6 | RGB_MATRIX_EFFECT(RANDOM_BREATH_RAINBOW) | ||
7 | |||
8 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
9 | |||
10 | #include "led/custom_gradient.c" | ||
11 | #include "led/diagonal.c" | ||
12 | #include "led/cool_diagonal.c" | ||
13 | #include "led/rainbow_reactive_simple/rainbow_reactive_simple.c" | ||
14 | #include "led/kitt.c" | ||
15 | #include "led/random_breath_rainbow.c" | ||
16 | |||
17 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/rules.mk b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/rules.mk new file mode 100644 index 000000000..c1f6494e2 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/rules.mk | |||
@@ -0,0 +1,6 @@ | |||
1 | MOUSEKEY_ENABLE = no # Mouse keys | ||
2 | VIA_ENABLE = yes | ||
3 | LTO_ENABLE = yes | ||
4 | |||
5 | # can this go just in the keymap? | ||
6 | RGB_MATRIX_CUSTOM_USER = yes | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/config.h b/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/config.h new file mode 100644 index 000000000..ba574e1e3 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/config.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* Copyright 2021 Thearesia | ||
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 DYNAMIC_KEYMAP_LAYER_COUNT 2 | ||
20 | |||
21 | /* Forcing to use NKRO instead 6KRO */ | ||
22 | #define FORCE_NKRO | ||
23 | |||
24 | /* Change USB Polling Rate to 1000hz and a larger keys per scan for elite gaming */ | ||
25 | #define USB_POLLING_INTERVAL_MS 1 | ||
26 | #define QMK_KEYS_PER_SCAN 12 | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/keymap.c b/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/keymap.c new file mode 100644 index 000000000..70279c334 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/keymap.c | |||
@@ -0,0 +1,201 @@ | |||
1 | /* Copyright 2021 Thearesia | ||
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 <string.h> | ||
18 | #include <math.h> | ||
19 | |||
20 | #include <lib/lib8tion/lib8tion.h> | ||
21 | |||
22 | #include QMK_KEYBOARD_H | ||
23 | |||
24 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
25 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
26 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
27 | // entirely and just use numbers. | ||
28 | |||
29 | enum layer_names { | ||
30 | _BASE = 0, | ||
31 | _FN = 1 | ||
32 | }; | ||
33 | |||
34 | // enum layer_keycodes { }; | ||
35 | |||
36 | enum user_rgb_mode { | ||
37 | RGB_MODE_ALL, | ||
38 | RGB_MODE_KEYLIGHT, | ||
39 | RGB_MODE_UNDERGLOW, | ||
40 | RGB_MODE_NONE, | ||
41 | }; | ||
42 | |||
43 | typedef union { | ||
44 | uint32_t raw; | ||
45 | struct { | ||
46 | uint8_t rgb_mode :8; | ||
47 | }; | ||
48 | } user_config_t; | ||
49 | |||
50 | user_config_t user_config; | ||
51 | |||
52 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
53 | |||
54 | /* | ||
55 | VolD ◯ VolU | ||
56 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ | ||
57 | │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Bckspc│Hom│ | ||
58 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ | ||
59 | │ Tab │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ [ │ ] │ \ │End│ | ||
60 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ | ||
61 | │ Caps │ a │ s │ d │ f │ g │ h │ j │ k │ l │ ; │ ' │ Enter │PgU│ | ||
62 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ | ||
63 | │ LShift │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ RSft │ ↑ │PgD│ | ||
64 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ | ||
65 | │LCrl│GUI │LAlt│ Space │RAlt│ Fn │ │ ← │ ↓ │ → │ | ||
66 | └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ | ||
67 | ◯ | ||
68 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ | ||
69 | │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ │ | ||
70 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ | ||
71 | │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ { │ } │ | │ │ | ||
72 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ | ||
73 | │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ : │ " │ │ │ | ||
74 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ | ||
75 | │ LShift │ Z │ X │ C │ V │ B │ N │ M │ < │ > │ ? │ RSht │ │ │ | ||
76 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ | ||
77 | │ │ │ │ │ │ │ │ │ │ │ | ||
78 | └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ | ||
79 | */ | ||
80 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ | ||
81 | [_BASE] = LAYOUT( | ||
82 | KC_ESC, 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_VOLD, KC_HOME, KC_VOLU, | ||
83 | 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_END, | ||
84 | 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_PGUP, | ||
85 | 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_PGDN, | ||
86 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT | ||
87 | ), | ||
88 | |||
89 | /* | ||
90 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ /────\ | ||
91 | │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Home │ │ │ | ||
92 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┐ │ │ | ||
93 | │Reset│ │ │ │ │ │ │ │ │Hud│Hui│ │ │Pause│Ins│ \────/ | ||
94 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ | ||
95 | │ │ │ │ │ │ │ │ │ │Sad│Sai│ │ PrtSc │Del│ | ||
96 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ | ||
97 | │ │ │ │ │ │ │ │ │Spd│Spi│ │ │Vai│Tog│ | ||
98 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ | ||
99 | │ │ │ │ │ │ Fn │ │Rod│Vad│Mod│ | ||
100 | └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ | ||
101 | */ | ||
102 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ | ||
103 | [_FN] = LAYOUT( | ||
104 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, _______, _______, _______, | ||
105 | RESET, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_HUI, _______, _______, _______, KC_PAUSE, KC_INS, | ||
106 | _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, _______, _______, KC_PSCR, KC_DEL, | ||
107 | _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, RGB_VAI, RGB_TOG, | ||
108 | _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD | ||
109 | ), | ||
110 | }; | ||
111 | |||
112 | void keyboard_post_init_kb(void) { | ||
113 | user_config.raw = eeconfig_read_user(); | ||
114 | switch (user_config.rgb_mode) { | ||
115 | case RGB_MODE_ALL: | ||
116 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
117 | rgb_matrix_enable_noeeprom(); | ||
118 | break; | ||
119 | case RGB_MODE_KEYLIGHT: | ||
120 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); | ||
121 | rgb_matrix_set_color_all(0, 0, 0); | ||
122 | break; | ||
123 | case RGB_MODE_UNDERGLOW: | ||
124 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
125 | rgb_matrix_set_color_all(0, 0, 0); | ||
126 | break; | ||
127 | case RGB_MODE_NONE: | ||
128 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
129 | rgb_matrix_set_color_all(0, 0, 0); | ||
130 | break; | ||
131 | } | ||
132 | } | ||
133 | |||
134 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
135 | switch (keycode) { | ||
136 | case RGB_TOG: | ||
137 | if (record->event.pressed) { | ||
138 | switch (rgb_matrix_get_flags()) { | ||
139 | case LED_FLAG_ALL: { | ||
140 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
141 | rgb_matrix_set_color_all(0, 0, 0); | ||
142 | user_config.rgb_mode = RGB_MODE_KEYLIGHT; | ||
143 | } | ||
144 | break; | ||
145 | case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { | ||
146 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
147 | rgb_matrix_set_color_all(0, 0, 0); | ||
148 | user_config.rgb_mode = RGB_MODE_UNDERGLOW; | ||
149 | } | ||
150 | break; | ||
151 | case (LED_FLAG_UNDERGLOW): { | ||
152 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
153 | rgb_matrix_set_color_all(0, 0, 0); | ||
154 | user_config.rgb_mode = RGB_MODE_NONE; | ||
155 | } | ||
156 | break; | ||
157 | default: { | ||
158 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
159 | rgb_matrix_enable_noeeprom(); | ||
160 | user_config.rgb_mode = RGB_MODE_ALL; | ||
161 | } | ||
162 | break; | ||
163 | } | ||
164 | eeconfig_update_user(user_config.raw); | ||
165 | } | ||
166 | return false; | ||
167 | } | ||
168 | return true; | ||
169 | } | ||
170 | |||
171 | #ifdef ENCODER_ENABLE | ||
172 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
173 | if (index == 0) { | ||
174 | if (clockwise) { | ||
175 | tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 3)); | ||
176 | } else { | ||
177 | tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 4)); | ||
178 | } | ||
179 | } | ||
180 | return true; | ||
181 | } | ||
182 | #endif | ||
183 | |||
184 | void rgb_matrix_indicators_user(void) { | ||
185 | HSV hsv = rgb_matrix_config.hsv; | ||
186 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
187 | hsv.h = time; | ||
188 | RGB rgb = hsv_to_rgb(hsv); | ||
189 | |||
190 | if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) { | ||
191 | if (host_keyboard_led_state().caps_lock) { | ||
192 | rgb_matrix_set_color(52, rgb.r, rgb.g, rgb.b); | ||
193 | } | ||
194 | } else { | ||
195 | if (host_keyboard_led_state().caps_lock) { | ||
196 | rgb_matrix_set_color(52, rgb.r, rgb.g, rgb.b); | ||
197 | } else { | ||
198 | rgb_matrix_set_color(52, 0, 0, 0); | ||
199 | } | ||
200 | } | ||
201 | } | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/readme.md b/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/readme.md new file mode 100644 index 000000000..0fb9e0a29 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # Personal Layout with VIA | ||
2 | |||
3 | Keymap is default 67 qwerty, 65 ansi blocker layout | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/rules.mk b/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/rules.mk new file mode 100644 index 000000000..36b7ba9cb --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/thearesia/rules.mk | |||
@@ -0,0 +1,2 @@ | |||
1 | VIA_ENABLE = yes | ||
2 | LTO_ENABLE = yes | ||
diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c b/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c index 78a17233e..76884095a 100644 --- a/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c +++ b/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c | |||
@@ -28,7 +28,7 @@ user_config_t user_config; | |||
28 | 28 | ||
29 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 29 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
30 | 30 | ||
31 | [0] = LAYOUT( | 31 | [0] = LAYOUT_65_ansi_blocker( |
32 | KC_ESC, 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_VOLD, KC_DEL, KC_VOLU, | 32 | KC_ESC, 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_VOLD, KC_DEL, KC_VOLU, |
33 | 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, | 33 | 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, |
34 | 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, | 34 | 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, |
@@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
36 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT | 36 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT |
37 | ), | 37 | ), |
38 | 38 | ||
39 | [1] = LAYOUT( | 39 | [1] = LAYOUT_65_ansi_blocker( |
40 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_HUI, _______, | 40 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_HUI, _______, |
41 | RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, | 41 | RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, |
42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, USER00, RGB_SAI, | 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, USER00, RGB_SAI, |
@@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
44 | _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI | 44 | _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI |
45 | ), | 45 | ), |
46 | 46 | ||
47 | [2] = LAYOUT( | 47 | [2] = LAYOUT_65_ansi_blocker( |
48 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 48 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
49 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 49 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
50 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 50 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
@@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
52 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | 52 | _______, _______, _______, _______, _______, _______, _______, _______, _______ |
53 | ), | 53 | ), |
54 | 54 | ||
55 | [3] = LAYOUT( | 55 | [3] = LAYOUT_65_ansi_blocker( |
56 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 56 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
57 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 57 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
diff --git a/keyboards/mwstudio/mw65_rgb/mw65_rgb.c b/keyboards/mwstudio/mw65_rgb/mw65_rgb.c index e49944f1c..5fd657c6b 100644 --- a/keyboards/mwstudio/mw65_rgb/mw65_rgb.c +++ b/keyboards/mwstudio/mw65_rgb/mw65_rgb.c | |||
@@ -18,28 +18,30 @@ | |||
18 | 18 | ||
19 | #ifdef RGB_MATRIX_ENABLE | 19 | #ifdef RGB_MATRIX_ENABLE |
20 | led_config_t g_led_config = { { | 20 | led_config_t g_led_config = { { |
21 | { 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68 }, | 21 | { 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68 }, |
22 | { 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67 }, | 22 | { 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67 }, |
23 | { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, 40, 39 }, | 23 | { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, 40, 39 }, |
24 | { 25, NO_LED, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 }, | 24 | { 25, NO_LED, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 }, |
25 | { 24, 23, 22, NO_LED, NO_LED, NO_LED, 21, NO_LED, NO_LED, 15, 20, 19, 18, 17, 16 }, | 25 | { 24, 23, 22, NO_LED, NO_LED, NO_LED, 21, NO_LED, NO_LED, NO_LED, 20, 19, 18, 17, 16 } |
26 | |||
27 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 } | ||
28 | }, { | 26 | }, { |
29 | { 175, 45 },{ 130, 45 },{ 85, 45 }, { 50, 45 }, { 15, 45 }, { 15, 35 }, { 15, 25 }, { 15, 10 }, | 27 | //Underglow (0 -> 15) |
30 | { 50, 10 }, { 85, 10 }, { 130, 10 }, { 175, 10 }, { 210, 10 }, { 210, 25 }, { 210, 35 }, { 210, 45 }, | 28 | {180, 52}, {146, 52}, {86 , 52}, {45 , 52}, {7 , 52}, {7 , 36}, {7 , 20}, {7 , 4}, {45 , 4}, {86 , 4}, {146, 4}, {180, 4}, {217, 4}, {217, 20}, {217, 36}, {217, 52}, |
31 | { 217, 54 }, { 203, 54 }, { 189, 54 }, { 166, 54 }, { 150, 54 }, { 95, 54 }, { 40, 54 }, { 24, 54 }, { 8, 54 }, | 29 | |
32 | { 17, 42 }, { 39, 42 }, { 53, 42 }, { 67, 42 }, { 81, 42 }, { 95, 42 }, { 109, 42 }, { 123, 42 }, { 137, 42 }, { 151, 42 }, { 165, 42 }, { 184, 42 }, { 203, 42 }, { 217, 42 }, | 30 | //Key matrix (16 -> 83) |
33 | { 217, 30 }, { 195, 30 }, { 172, 30 }, { 158, 30 }, { 144, 30 }, { 130, 30 }, { 116, 30 }, { 102, 30 }, { 88, 30 }, { 74, 30 }, { 60, 30 }, { 46, 30 }, { 32, 30 },{ 13, 30 }, | 31 | {224, 64}, {209, 64}, {194, 64}, {173, 64}, {156, 64}, {96 , 64}, {36 , 64}, {19 , 64}, {2 , 64}, |
34 | { 9, 18 }, { 25, 18 }, { 39, 18 }, { 53, 18 }, { 67, 18 }, { 81, 18 }, { 95, 18 }, { 109, 18 }, { 123, 18 }, { 137, 18 }, { 151, 18 }, { 165, 18 }, { 181, 18 }, { 199, 18 }, { 217, 18 }, | 32 | {8 , 48}, {31 , 48}, {46 , 48}, {61 , 48}, {76 , 48}, {91 , 48}, {106, 48}, {121, 48}, {136, 48}, {151, 48}, {166, 48}, {188, 48}, {210, 48}, {224, 48}, |
35 | { 217, 6 }, { 196, 6 }, { 175, 6 }, { 161, 6 }, { 147, 6 }, { 133, 6 }, { 119, 6 }, { 105, 6 }, { 91, 6 }, { 77, 6 }, { 63, 6 }, { 49, 6 }, { 35, 6 }, { 21, 6 }, { 7, 6 }, | 33 | {224, 32}, {200, 32}, {175, 32}, {160, 32}, {145, 32}, {130, 32}, {115, 32}, {100, 32}, {85 , 32}, {70 , 32}, {55 , 32}, {40 , 32}, {25 , 32}, {5 , 32}, |
34 | {3 , 16}, {21 , 16}, {36 , 16}, {51 , 16}, {66 , 16}, {81 , 16}, {96 , 16}, {111, 16}, {126, 16}, {141, 16}, {156, 16}, {171, 16}, {186, 16}, {205, 16}, {224, 16}, | ||
35 | {224, 0}, {202, 0}, {180, 0}, {165, 0}, {150, 0}, {135, 0}, {120, 0}, {105, 0}, {90 , 0}, {75 , 0}, {60 , 0}, {45 , 0}, {30 , 0}, {15 , 0}, {0 , 0}, | ||
36 | }, { | 36 | }, { |
37 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 37 | //Underglow (0 -> 15) |
38 | 1, 1, 1, 1, 1, 1, 1, 1, 1, | 38 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
39 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 39 | |
40 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 40 | //Key matrix (16 -> 82) |
41 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 41 | 4, 4, 4, 1, 1, 4, 1, 1, 1, |
42 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 | 42 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4, 4, |
43 | 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, | ||
44 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, | ||
45 | 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
43 | } }; | 46 | } }; |
44 | #endif | 47 | #endif |
45 | |||
diff --git a/keyboards/mwstudio/mw65_rgb/mw65_rgb.h b/keyboards/mwstudio/mw65_rgb/mw65_rgb.h index fb769eda0..3c49721df 100644 --- a/keyboards/mwstudio/mw65_rgb/mw65_rgb.h +++ b/keyboards/mwstudio/mw65_rgb/mw65_rgb.h | |||
@@ -13,6 +13,7 @@ | |||
13 | * You should have received a copy of the GNU General Public License | 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/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | */ | 15 | */ |
16 | |||
16 | #pragma once | 17 | #pragma once |
17 | 18 | ||
18 | #include "quantum.h" | 19 | #include "quantum.h" |
@@ -34,16 +35,15 @@ | |||
34 | */ | 35 | */ |
35 | 36 | ||
36 | #define LAYOUT( \ | 37 | #define LAYOUT( \ |
37 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K44, K0E, K43, \ | 38 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K44, K0E, K43, \ |
38 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ | 39 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ |
39 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ | 40 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ |
40 | K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ | 41 | K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ |
41 | K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E \ | 42 | K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E \ |
42 | ) { \ | 43 | ) { \ |
43 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ | 44 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ |
44 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ | 45 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ |
45 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ | 46 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ |
46 | { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ | 47 | { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ |
47 | { K40, K41, K42, K43, K44, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E }, \ | 48 | { K40, K41, K42, K43, K44, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E }, \ |
48 | { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX } \ | ||
49 | } | 49 | } |
diff --git a/keyboards/mwstudio/mw65_rgb/rules.mk b/keyboards/mwstudio/mw65_rgb/rules.mk index 9407031ed..e2e979fb6 100644 --- a/keyboards/mwstudio/mw65_rgb/rules.mk +++ b/keyboards/mwstudio/mw65_rgb/rules.mk | |||
@@ -16,6 +16,8 @@ NKRO_ENABLE = yes # Enable N-Key Rollover | |||
16 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | 16 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality |
17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | 17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow |
18 | AUDIO_ENABLE = no # Audio output | 18 | AUDIO_ENABLE = no # Audio output |
19 | |||
19 | RGB_MATRIX_ENABLE = yes | 20 | RGB_MATRIX_ENABLE = yes |
20 | RGB_MATRIX_DRIVER = WS2812 | 21 | RGB_MATRIX_DRIVER = WS2812 |
22 | |||
21 | ENCODER_ENABLE = yes | 23 | ENCODER_ENABLE = yes |