Skip to content

Commit

Permalink
Resolved issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HorrorTroll committed Jan 29, 2022
1 parent 26f3ba0 commit 6593c1e
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 27 deletions.
2 changes: 1 addition & 1 deletion keyboards/mwstudio/mw65_rgb/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
#define ENABLE_RGB_MATRIX_HUE_BREATHING
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
#define ENABLE_RGB_MATRIX_HUE_WAVE
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
#define ENABLE_RGB_MATRIX_PIXEL_RAIN
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL

#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
Expand Down
19 changes: 10 additions & 9 deletions keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@

#ifdef RGB_MATRIX_ENABLE
/* RGB Matrix config */
#undef DISABLE_RGB_MATRIX_BAND_SAT
#undef DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
#undef DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT

#undef DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#undef DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#undef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#undef DISABLE_RGB_MATRIX_SPLASH
#undef DISABLE_RGB_MATRIX_SOLID_SPLASH
#undef ENABLE_RGB_MATRIX_BAND_SAT
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
#undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL

#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#undef ENABLE_RGB_MATRIX_SPLASH
#undef ENABLE_RGB_MATRIX_SOLID_SPLASH
#endif
6 changes: 3 additions & 3 deletions keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
└────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
*/
/* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */
[_BASE] = LAYOUT_65_ansi_blocker(
[_BASE] = LAYOUT(
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,
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,
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,
Expand All @@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
└────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
*/
/* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */
[_FN] = LAYOUT_65_ansi_blocker(
[_FN] = LAYOUT(
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, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUSE, KC_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_DEL,
Expand All @@ -93,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
└────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
*/
/* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */
[_RN] = LAYOUT_65_ansi_blocker(
[_RN] = LAYOUT(
RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, G1_HUD, G1_HUI, G1_SAD, G1_SAI, G1_VAD, G1_VAI, _______, RGB_HUD, RGB_HUI, _______, RGB_C_E, _______, _______, RGB_TOG,
_______, G2_HUD, G2_HUI, G2_SAD, G2_SAI, G2_VAD, G2_VAI, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______,
Expand Down
18 changes: 14 additions & 4 deletions keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap_stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <string.h>
#include <math.h>

#include <lib/lib8tion/lib8tion.h>

// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
Expand Down Expand Up @@ -92,7 +97,7 @@ void keyboard_post_init_kb(void) {
break;
case RGB_MODE_NONE:
rgb_matrix_set_flags(LED_FLAG_NONE);
rgb_matrix_disable_noeeprom();
rgb_matrix_set_color_all(0, 0, 0);
break;
}
}
Expand Down Expand Up @@ -250,7 +255,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break;
case (LED_FLAG_UNDERGLOW): {
rgb_matrix_set_flags(LED_FLAG_NONE);
rgb_matrix_disable_noeeprom();
rgb_matrix_set_color_all(0, 0, 0);
user_config.rgb_mode = RGB_MODE_NONE;
}
break;
Expand Down Expand Up @@ -311,13 +316,18 @@ void rgb_matrix_indicators_user(void) {
break;
}

HSV hsv = rgb_matrix_config.hsv;
uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1));
hsv.h = time;
RGB rgb = hsv_to_rgb(hsv);

if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) {
if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(52, 217, 71, 115);
rgb_matrix_set_color(52, rgb.r, rgb.g, rgb.b);
}
} else {
if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(52, 217, 71, 115);
rgb_matrix_set_color(52, rgb.r, rgb.g, rgb.b);
} else {
rgb_matrix_set_color(52, 0, 0, 0);
}
Expand Down
22 changes: 16 additions & 6 deletions keyboards/mwstudio/mw65_rgb/keymaps/thearesia/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <string.h>
#include <math.h>

#include <lib/lib8tion/lib8tion.h>

#include QMK_KEYBOARD_H

// Each layer gets a name for readability, which is then used in the keymap matrix below.
Expand Down Expand Up @@ -73,7 +78,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
└────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
*/
/* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */
[_BASE] = LAYOUT_65_ansi_blocker(
[_BASE] = LAYOUT(
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,
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,
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,
Expand All @@ -95,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
└────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
*/
/* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */
[_FN] = LAYOUT_65_ansi_blocker(
[_FN] = LAYOUT(
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, _______, _______, _______,
RESET, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_HUI, _______, _______, _______, KC_PAUSE, KC_INS,
_______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, _______, _______, KC_PSCR, KC_DEL,
Expand All @@ -121,7 +126,7 @@ void keyboard_post_init_kb(void) {
break;
case RGB_MODE_NONE:
rgb_matrix_set_flags(LED_FLAG_NONE);
rgb_matrix_disable_noeeprom();
rgb_matrix_set_color_all(0, 0, 0);
break;
}
}
Expand All @@ -145,7 +150,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break;
case (LED_FLAG_UNDERGLOW): {
rgb_matrix_set_flags(LED_FLAG_NONE);
rgb_matrix_disable_noeeprom();
rgb_matrix_set_color_all(0, 0, 0);
user_config.rgb_mode = RGB_MODE_NONE;
}
break;
Expand Down Expand Up @@ -177,13 +182,18 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
#endif

void rgb_matrix_indicators_user(void) {
HSV hsv = rgb_matrix_config.hsv;
uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1));
hsv.h = time;
RGB rgb = hsv_to_rgb(hsv);

if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) {
if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(52, 217, 71, 115);
rgb_matrix_set_color(52, rgb.r, rgb.g, rgb.b);
}
} else {
if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(52, 217, 71, 115);
rgb_matrix_set_color(52, rgb.r, rgb.g, rgb.b);
} else {
rgb_matrix_set_color(52, 0, 0, 0);
}
Expand Down
3 changes: 2 additions & 1 deletion keyboards/mwstudio/mw65_rgb/mw65_rgb.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "quantum.h"
Expand All @@ -33,7 +34,7 @@
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
*/

#define LAYOUT_65_ansi_blocker( \
#define LAYOUT( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K44, K0E, K43, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \
Expand Down
3 changes: 0 additions & 3 deletions keyboards/mwstudio/mw65_rgb/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812

ENCODER_ENABLE = yes

LAYOUTS = 65_ansi_blocker

0 comments on commit 6593c1e

Please sign in to comment.