mirror of
https://github.com/jmwtsn/qmk_firmware.git
synced 2026-06-03 11:43:35 -03:00
Remove override of QK_{LED,RGB}_MATRIX_TOGGLE keycode (#25672)
This commit is contained in:
@@ -140,30 +140,3 @@ void housekeeping_task_kb(void){
|
||||
gpio_write_pin(LED_MAC_OS_PIN, (get_highest_layer(default_layer_state) == 3));
|
||||
gpio_write_pin(LED_WIN_LOCK_PIN, keymap_config.no_gui);
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,32 +157,3 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,32 +6,6 @@
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case RM_TOGG:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_kb(void) {
|
||||
if (!rgb_matrix_indicators_user()) {
|
||||
return false;
|
||||
|
||||
@@ -18,5 +18,4 @@
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_VCC_VCC
|
||||
#define IS31FL3733_PWM_FREQUENCY IS31FL3733_PWM_FREQUENCY_26K7_HZ
|
||||
|
||||
#define RGB_MATRIX_CYCLE_ZONES_ENABLE
|
||||
#define RGB_MATRIX_CAPS_LOCK_INDEX 30
|
||||
|
||||
@@ -18,5 +18,4 @@
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_VCC_VCC
|
||||
#define IS31FL3733_PWM_FREQUENCY IS31FL3733_PWM_FREQUENCY_26K7_HZ
|
||||
|
||||
#define RGB_MATRIX_CYCLE_ZONES_ENABLE
|
||||
#define RGB_MATRIX_CAPS_LOCK_INDEX 50
|
||||
|
||||
@@ -19,35 +19,4 @@ bool rgb_matrix_indicators_kb(void) {
|
||||
return true;
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef RGB_MATRIX_CYCLE_ZONES_ENABLE
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!record->event.pressed) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL:
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR):
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
break;
|
||||
case LED_FLAG_UNDERGLOW:
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
break;
|
||||
default:
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -13,5 +13,4 @@
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_VCC_VCC
|
||||
#define IS31FL3733_PWM_FREQUENCY IS31FL3733_PWM_FREQUENCY_26K7_HZ
|
||||
|
||||
#define RGB_MATRIX_CYCLE_ZONES_ENABLE
|
||||
#define RGB_MATRIX_CAPS_LOCK_INDEX 62
|
||||
|
||||
@@ -18,5 +18,3 @@
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_VCC_VCC
|
||||
#define IS31FL3733_I2C_ADDRESS_3 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_PWM_FREQUENCY IS31FL3733_PWM_FREQUENCY_26K7_HZ
|
||||
|
||||
#define RGB_MATRIX_CYCLE_ZONES_ENABLE
|
||||
|
||||
@@ -101,39 +101,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_UNDERGLOW): {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
rgb_matrix_set_color(46, 0, 0, 0);
|
||||
rgb_matrix_set_color(104, 0, 0, 0);
|
||||
|
||||
@@ -25,38 +25,6 @@
|
||||
#include <math.h>
|
||||
#include <lib/lib8tion/lib8tion.h>
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_UNDERGLOW): {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_kb(void) {
|
||||
if (!rgb_matrix_indicators_user()) {
|
||||
return false;
|
||||
|
||||
@@ -31,8 +31,6 @@ enum layer_names {
|
||||
_FN,
|
||||
};
|
||||
|
||||
// enum layer_keycodes { };
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/*
|
||||
@@ -91,38 +89,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_UNDERGLOW): {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
hsv_t hsv = rgb_matrix_config.hsv;
|
||||
uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1));
|
||||
|
||||
@@ -44,20 +44,6 @@ typedef struct {
|
||||
bool reflected;
|
||||
} CUSTOM_PRESETS;
|
||||
|
||||
enum user_rgb_mode {
|
||||
RGB_MODE_ALL,
|
||||
RGB_MODE_NONE,
|
||||
};
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
uint8_t rgb_mode :8;
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
|
||||
enum layer_keycodes {
|
||||
//Custom Gradient control keycode
|
||||
G1_HUI = SAFE_RANGE, //Custom gradient color 1 hue increase
|
||||
@@ -80,20 +66,6 @@ enum layer_keycodes {
|
||||
RGB_C_E, //Cycle user effect
|
||||
};
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
user_config.raw = eeconfig_read_user();
|
||||
switch (user_config.rgb_mode) {
|
||||
case RGB_MODE_ALL:
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
break;
|
||||
case RGB_MODE_NONE:
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
process_record_user_oled(keycode, record);
|
||||
|
||||
@@ -229,25 +201,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_NONE;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
user_config.rgb_mode = RGB_MODE_ALL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
eeconfig_update_user(user_config.raw);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -17,52 +17,6 @@
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case QK_RGB_MATRIX_MODE_NEXT:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_mode()) {
|
||||
case RGB_MATRIX_SOLID_MULTISPLASH:
|
||||
rgb_matrix_mode(RGB_MATRIX_SOLID_COLOR);
|
||||
return false;
|
||||
default:
|
||||
rgb_matrix_step();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case QK_RGB_MATRIX_MODE_PREVIOUS:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_mode()) {
|
||||
case RGB_MATRIX_SOLID_COLOR:
|
||||
rgb_matrix_mode(RGB_MATRIX_SOLID_MULTISPLASH);
|
||||
return false;
|
||||
default:
|
||||
rgb_matrix_step_reverse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_kb(void) {
|
||||
if (!rgb_matrix_indicators_user()) {
|
||||
@@ -76,14 +30,4 @@ bool rgb_matrix_indicators_kb(void) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void keyboard_post_init_kb(void) {
|
||||
if (!(rgb_matrix_get_flags() & LED_FLAG_ALL)) {
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} else {
|
||||
rgb_matrix_mode_noeeprom(RGB_MATRIX_CUSTOM_STARTUP_SWIRL_ANIM);
|
||||
}
|
||||
|
||||
keyboard_post_init_user();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -164,31 +164,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,44 +38,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
)
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_UNDERGLOW: {
|
||||
rgb_matrix_set_flags(LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_INDICATOR: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_disable_noeeprom();
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true; //Process all other keycodes normally
|
||||
}
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
led_t host_leds = host_keyboard_led_state();
|
||||
if (host_leds.caps_lock) {
|
||||
|
||||
@@ -123,32 +123,6 @@ const snled27351_led_t PROGMEM g_snled27351_leds[SNLED27351_LED_COUNT] = {
|
||||
|
||||
// clang-format on
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -123,32 +123,6 @@ const snled27351_led_t PROGMEM g_snled27351_leds[SNLED27351_LED_COUNT] = {
|
||||
|
||||
// clang-format on
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case LM_TOGG:
|
||||
if (record->event.pressed) {
|
||||
switch (led_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
led_matrix_set_flags(LED_FLAG_NONE);
|
||||
led_matrix_set_value_all(0);
|
||||
} break;
|
||||
default: {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!led_matrix_is_enabled()) {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
led_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!led_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -28,54 +28,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
case QK_LED_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (led_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
led_matrix_set_flags(LED_FLAG_NONE);
|
||||
led_matrix_set_value_all(0);
|
||||
} break;
|
||||
default: {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!led_matrix_is_enabled()) {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
led_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void keyboard_post_init_kb(void) {
|
||||
gpio_set_pin_output_push_pull(LED_MAC_OS_PIN);
|
||||
gpio_set_pin_output_push_pull(LED_WIN_OS_PIN);
|
||||
|
||||
@@ -31,64 +31,20 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
#endif // DIP_SWITCH_ENABLE
|
||||
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
# define LED_TOGGLE_KEYCODE QK_RGB_MATRIX_TOGGLE
|
||||
# define LED_SET_FLAGS rgb_matrix_set_flags
|
||||
# define LED_GET_FLAGS rgb_matrix_get_flags
|
||||
# define LED_SET_ALL_OFF rgb_matrix_set_color_all(COLOR_BLACK)
|
||||
# define LED_IS_ENABLED rgb_matrix_is_enabled
|
||||
# define LED_ENABLE rgb_matrix_enable
|
||||
# define LED_MATRIX_INDICATORS_KB rgb_matrix_indicators_kb
|
||||
# define LED_MATRIX_INDICATORS_USER rgb_matrix_indicators_user
|
||||
# define LED_MATRIX_SET_COLOR rgb_matrix_set_color
|
||||
# define LED_MATRIX_UPDATE_PWN_BUFFERS rgb_matrix_update_pwm_buffers
|
||||
# define LED_MATRIX_INDICATORS_NONE_KB rgb_matrix_indicators_none_kb
|
||||
# define LED_MATRIX_IS_ENABLED rgb_matrix_is_enabled
|
||||
# define COLOR_WHITE 255, 255, 255
|
||||
# define COLOR_BLACK 0, 0, 0
|
||||
# endif
|
||||
|
||||
# ifdef LED_MATRIX_ENABLE
|
||||
# define LED_TOGGLE_KEYCODE QK_LED_MATRIX_TOGGLE
|
||||
# define LED_SET_FLAGS led_matrix_set_flags
|
||||
# define LED_GET_FLAGS led_matrix_get_flags
|
||||
# define LED_SET_ALL_OFF led_matrix_set_value_all(COLOR_BLACK)
|
||||
# define LED_IS_ENABLED led_matrix_is_enabled
|
||||
# define LED_ENABLE led_matrix_enable
|
||||
# define LED_MATRIX_INDICATORS_KB led_matrix_indicators_kb
|
||||
# define LED_MATRIX_INDICATORS_USER led_matrix_indicators_user
|
||||
# define LED_MATRIX_SET_COLOR led_matrix_set_value
|
||||
# define LED_MATRIX_UPDATE_PWN_BUFFERS led_matrix_update_pwm_buffers
|
||||
# define LED_MATRIX_INDICATORS_NONE_KB led_matrix_indicators_none_kb
|
||||
# define LED_MATRIX_IS_ENABLED led_matrix_is_enabled
|
||||
# define COLOR_WHITE 255
|
||||
# define COLOR_BLACK 0
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case LED_TOGGLE_KEYCODE:
|
||||
if (record->event.pressed) {
|
||||
switch (LED_GET_FLAGS()) {
|
||||
case LED_FLAG_ALL: {
|
||||
LED_SET_FLAGS(LED_FLAG_NONE);
|
||||
LED_SET_ALL_OFF;
|
||||
} break;
|
||||
default: {
|
||||
LED_SET_FLAGS(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!LED_IS_ENABLED()) {
|
||||
LED_SET_FLAGS(LED_FLAG_ALL);
|
||||
LED_ENABLE();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LED_MATRIX_INDICATORS_KB(void) {
|
||||
if (!LED_MATRIX_INDICATORS_USER()) {
|
||||
return false;
|
||||
|
||||
@@ -28,54 +28,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
case QK_LED_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (led_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
led_matrix_set_flags(LED_FLAG_NONE);
|
||||
led_matrix_set_value_all(0);
|
||||
} break;
|
||||
default: {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!led_matrix_is_enabled()) {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
led_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void keyboard_post_init_kb(void) {
|
||||
gpio_set_pin_output_push_pull(LED_MAC_OS_PIN);
|
||||
gpio_set_pin_output_push_pull(LED_WIN_OS_PIN);
|
||||
|
||||
@@ -41,44 +41,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
case QK_LED_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (led_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
led_matrix_set_flags(LED_FLAG_NONE);
|
||||
led_matrix_set_value_all(0);
|
||||
} break;
|
||||
default: {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!led_matrix_is_enabled()) {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
led_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
case KC_OSSW:
|
||||
if (record->event.pressed) {
|
||||
// Switches default layer between `MAC_BASE` and `WIN_BASE` (0 and 2)
|
||||
|
||||
@@ -18,30 +18,6 @@
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(NUM_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
# endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -32,34 +32,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
# endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -29,31 +29,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
#endif
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
|
||||
@@ -29,31 +29,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
#endif
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && (defined(CAPS_LOCK_LED_INDEX) || defined(NUM_LOCK_LED_INDEX))
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
|
||||
@@ -30,32 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -30,34 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
# endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -30,30 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -33,32 +33,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -29,31 +29,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
#endif // DIP_SWITCH_ENABLE
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
|
||||
@@ -32,34 +32,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && (defined(CAPS_LOCK_LED_INDEX) || defined(NUM_LOCK_LED_INDEX))
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
# endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -32,32 +32,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && (defined(CAPS_LOCK_LED_INDEX) || defined(NUM_LOCK_LED_INDEX))
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -31,32 +31,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
// clang-format on
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -30,32 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -30,32 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -30,32 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -30,32 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -30,32 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
@@ -74,32 +48,6 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
|
||||
#if defined(LED_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
case LM_TOGG:
|
||||
if (record->event.pressed) {
|
||||
switch (led_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
led_matrix_set_flags(LED_FLAG_NONE);
|
||||
led_matrix_set_value_all(0);
|
||||
} break;
|
||||
default: {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!led_matrix_is_enabled()) {
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
led_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!led_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
|
||||
|
||||
@@ -32,32 +32,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -32,32 +32,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -29,31 +29,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
#endif // DIP_SWITCH_ENABLE
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
|
||||
@@ -32,32 +32,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -30,32 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -32,32 +32,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -36,32 +36,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && (defined(CAPS_LOCK_LED_INDEX) || defined(NUM_LOCK_LED_INDEX))
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
@@ -30,32 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -30,32 +30,6 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { return false; }
|
||||
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||
|
||||
@@ -31,22 +31,6 @@ enum layer_names {
|
||||
_FN,
|
||||
};
|
||||
|
||||
enum user_rgb_mode {
|
||||
RGB_MODE_ALL,
|
||||
RGB_MODE_NONE,
|
||||
};
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
uint8_t rgb_mode :8;
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
|
||||
// enum layer_keycodes { };
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/*
|
||||
@@ -119,45 +103,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
user_config.raw = eeconfig_read_user();
|
||||
switch (user_config.rgb_mode) {
|
||||
case RGB_MODE_ALL:
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
break;
|
||||
case RGB_MODE_NONE:
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_NONE;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
user_config.rgb_mode = RGB_MODE_ALL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
eeconfig_update_user(user_config.raw);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
||||
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
|
||||
@@ -164,32 +164,3 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// clang-format on
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,30 +140,3 @@ void housekeeping_task_kb(void){
|
||||
gpio_write_pin(LED_MAC_OS_PIN, (get_highest_layer(default_layer_state) == 3));
|
||||
gpio_write_pin(LED_WIN_LOCK_PIN, keymap_config.no_gui);
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled()) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,39 +159,3 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max)
|
||||
}
|
||||
|
||||
#endif
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record)
|
||||
{
|
||||
if (!process_record_user(keycode, record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
switch (keycode)
|
||||
{
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
switch (rgb_matrix_get_flags())
|
||||
{
|
||||
case LED_FLAG_ALL:
|
||||
{
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!rgb_matrix_is_enabled())
|
||||
{
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable();
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,24 +32,6 @@ enum layer_names {
|
||||
_FN,
|
||||
};
|
||||
|
||||
enum user_rgb_mode {
|
||||
RGB_MODE_ALL,
|
||||
RGB_MODE_KEYLIGHT,
|
||||
RGB_MODE_UNDERGLOW,
|
||||
RGB_MODE_NONE,
|
||||
};
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
uint8_t rgb_mode :8;
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
|
||||
// enum layer_keycodes { };
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/*
|
||||
@@ -108,66 +90,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
user_config.raw = eeconfig_read_user();
|
||||
switch (user_config.rgb_mode) {
|
||||
case RGB_MODE_ALL:
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
break;
|
||||
case RGB_MODE_KEYLIGHT:
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
case RGB_MODE_UNDERGLOW:
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
case RGB_MODE_NONE:
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_KEYLIGHT;
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_UNDERGLOW;
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_UNDERGLOW): {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_NONE;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
user_config.rgb_mode = RGB_MODE_ALL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
eeconfig_update_user(user_config.raw);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
hsv_t hsv = rgb_matrix_config.hsv;
|
||||
uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1));
|
||||
|
||||
@@ -28,24 +28,6 @@ enum layer_names {
|
||||
_FN,
|
||||
};
|
||||
|
||||
enum user_rgb_mode {
|
||||
RGB_MODE_ALL,
|
||||
RGB_MODE_KEYLIGHT,
|
||||
RGB_MODE_UNDERGLOW,
|
||||
RGB_MODE_NONE,
|
||||
};
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
uint8_t rgb_mode :8;
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
|
||||
// enum layer_keycodes { };
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/*
|
||||
@@ -104,66 +86,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
user_config.raw = eeconfig_read_user();
|
||||
switch (user_config.rgb_mode) {
|
||||
case RGB_MODE_ALL:
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
break;
|
||||
case RGB_MODE_KEYLIGHT:
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
case RGB_MODE_UNDERGLOW:
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
case RGB_MODE_NONE:
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_KEYLIGHT;
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_UNDERGLOW;
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_UNDERGLOW): {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_NONE;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
user_config.rgb_mode = RGB_MODE_ALL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
eeconfig_update_user(user_config.raw);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
hsv_t hsv = rgb_matrix_config.hsv;
|
||||
uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1));
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum my_keycodes {
|
||||
RETRO_RGB = QK_USER_0
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_tkl_ansi_tsangan( /* Base */
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS,
|
||||
@@ -34,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, RM_TOGG, RM_NEXT, RM_HUED, RM_HUEU, RM_SATD, RM_SATU, RM_VALD, RM_VALU, RM_SPDD, RM_SPDU, _______, _______,
|
||||
_______, _______, _______, RETRO_RGB, _______, _______, _______, _______, _______, _______),
|
||||
_______, _______, _______, RM_FLGN, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
};
|
||||
|
||||
@@ -50,24 +46,3 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case RETRO_RGB:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_INDICATOR);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false; // Skip all further processing of this key
|
||||
default:
|
||||
return true; // Process all other keycodes normally
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum my_keycodes {
|
||||
RETRO_RGB = QK_USER_0
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_tkl_iso_tsangan( /* Base */
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS,
|
||||
@@ -34,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, RM_TOGG, RM_NEXT, RM_HUED, RM_HUEU, RM_SATD, RM_SATU, RM_VALD, RM_VALU, RM_SPDD, RM_SPDU, _______, _______,
|
||||
_______, _______, _______, RETRO_RGB, _______, _______, _______, _______, _______, _______),
|
||||
_______, _______, _______, RM_FLGN, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
};
|
||||
|
||||
@@ -50,24 +46,3 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case RETRO_RGB:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_INDICATOR);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false; // Skip all further processing of this key
|
||||
default:
|
||||
return true; // Process all other keycodes normally
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/* Copyright 2023 Pangorin <https://github.com/pangorin>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_UNDERGLOW): {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -23,28 +23,6 @@
|
||||
#include <math.h>
|
||||
#include <lib/lib8tion/lib8tion.h>
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_kb(void) {
|
||||
if (!rgb_matrix_indicators_user()) {
|
||||
return false;
|
||||
|
||||
@@ -129,61 +129,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
)
|
||||
};
|
||||
|
||||
// For RGBRST Keycode
|
||||
#if defined(RGB_MATRIX_ENABLE)
|
||||
void rgb_matrix_increase_flags(void)
|
||||
{
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_UNDERGLOW: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_disable_noeeprom();
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void rgb_matrix_decrease_flags(void)
|
||||
{
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_disable_noeeprom();
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_UNDERGLOW: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RGB_OLED_MENU
|
||||
uint8_t rgb_encoder_state = 4;
|
||||
|
||||
@@ -195,7 +140,7 @@ const rgb_matrix_f rgb_matrix_functions[6][2] = {
|
||||
{ rgb_matrix_increase_val, rgb_matrix_decrease_val },
|
||||
{ rgb_matrix_increase_speed, rgb_matrix_decrease_speed },
|
||||
{ rgb_matrix_step, rgb_matrix_step_reverse },
|
||||
{ rgb_matrix_increase_flags, rgb_matrix_decrease_flags }
|
||||
{ rgb_matrix_flags_step, rgb_matrix_flags_step_reverse }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -272,13 +217,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(KEYBOARD_rgbkb_sol_rev2)
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
rgb_matrix_increase_flags();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
case RGB_MENU:
|
||||
#ifdef RGB_OLED_MENU
|
||||
if (record->event.pressed) {
|
||||
|
||||
@@ -80,35 +80,6 @@ void matrix_slave_scan_kb(void) {
|
||||
matrix_slave_scan_user();
|
||||
}
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
void rgb_matrix_increase_flags(void)
|
||||
{
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case LED_FLAG_UNDERGLOW: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_disable_noeeprom();
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
__attribute__((weak))
|
||||
void render_layer_status(void) {
|
||||
// Keymap specific, expected to be overridden
|
||||
@@ -185,22 +156,6 @@ bool oled_task_kb(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record))
|
||||
return false;
|
||||
|
||||
switch(keycode) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
rgb_matrix_increase_flags();
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
void keyboard_post_init_kb(void) {
|
||||
touch_encoder_init();
|
||||
transaction_register_rpc(TOUCH_ENCODER_SYNC, touch_encoder_slave_sync);
|
||||
|
||||
@@ -18,8 +18,3 @@ void render_layer_status(void);
|
||||
void render_leds_status(void);
|
||||
void render_touch_status(void);
|
||||
void render_audio_status(void);
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
// utility function to cycle active led zones
|
||||
void rgb_matrix_increase_flags(void);
|
||||
#endif
|
||||
|
||||
@@ -107,31 +107,6 @@ void suspend_wakeup_init_kb(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
# endif
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void board_init(void) {
|
||||
// JTAG-DP Disabled and SW-DP Disabled
|
||||
AFIO->MAPR = (AFIO->MAPR & ~AFIO_MAPR_SWJ_CFG_Msk) | AFIO_MAPR_SWJ_CFG_DISABLE;
|
||||
|
||||
@@ -107,31 +107,6 @@ void suspend_wakeup_init_kb(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
# endif
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void board_init(void) {
|
||||
// JTAG-DP Disabled and SW-DP Disabled
|
||||
AFIO->MAPR = (AFIO->MAPR & ~AFIO_MAPR_SWJ_CFG_Msk) | AFIO_MAPR_SWJ_CFG_DISABLE;
|
||||
|
||||
@@ -5,30 +5,6 @@
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(NUM_LOCK_INDEX)
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
switch (keycode) {
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
case QK_RGB_MATRIX_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
# endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user