Fix Per Key LED Indicator Callbacks (#18450)
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com> Co-authored-by: Nick Brassel <nick@tzarc.org>
This commit is contained in:
parent
09d3e27710
commit
64b1ed4550
218 changed files with 1430 additions and 1271 deletions
|
@ -23,7 +23,7 @@
|
|||
|
||||
// Allow hooking into the RGB matrix indications using keymap code
|
||||
|
||||
// Modulates the brightness of indicator
|
||||
// Modulates the brightness of indicator
|
||||
RGB helper_dimmer(uint8_t r, uint8_t g, uint8_t b) {
|
||||
RGB output;
|
||||
output.r = r / 2;
|
||||
|
@ -63,12 +63,12 @@ __attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_mi
|
|||
return false;
|
||||
}
|
||||
// Set RGB state depending on layer
|
||||
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||
uint8_t thisInd = 3;
|
||||
RGB thisCol;
|
||||
// Load keymap hooks
|
||||
if(rgb_matrix_indicators_advanced_keymap(led_min, led_max)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
// Grab color info
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
|
@ -110,6 +110,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
|||
break;
|
||||
}
|
||||
helper_painter(led_min, led_max, thisCol, thisInd);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Hook into shutdown code to make all perkey LED's red on hitting reset
|
||||
|
@ -120,11 +121,3 @@ void shutdown_rgb(void) {
|
|||
// Delay until this registers
|
||||
while(timer_elapsed(timer_start) < 250) {wait_ms(1);}
|
||||
}
|
||||
|
||||
// Hook into suspend code
|
||||
void suspend_power_down_rgb(void) {
|
||||
rgb_matrix_set_suspend_state(true);
|
||||
}
|
||||
void suspend_wakeup_init_rgb(void) {
|
||||
rgb_matrix_set_suspend_state(false);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
// For custom indicators
|
||||
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max);
|
||||
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max);
|
||||
// Hook into shutdown code
|
||||
void shutdown_rgb(void);
|
||||
void suspend_wakeup_init_rgb(void);
|
||||
|
|
|
@ -36,7 +36,7 @@ void check_default_layer(uint8_t mode, uint8_t type) {
|
|||
}
|
||||
}
|
||||
|
||||
void rgb_matrix_indicators_user(void) {
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
if (userspace_config.rgb_layer_change && rgb_matrix_config.enable) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _RAISE:
|
||||
|
@ -55,6 +55,7 @@ void rgb_matrix_indicators_user(void) {
|
|||
}
|
||||
check_default_layer(0, LED_FLAG_MODIFIER);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
|
||||
|
|
|
@ -91,9 +91,9 @@ bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) {
|
|||
__attribute__((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) {
|
||||
return true;
|
||||
}
|
||||
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||
if (!rgb_matrix_indicators_advanced_keymap(led_min, led_max)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(RGBLIGHT_ENABLE)
|
||||
|
@ -140,11 +140,12 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
__attribute__((weak)) bool rgb_matrix_indicators_keymap(void) {
|
||||
return true;
|
||||
}
|
||||
void rgb_matrix_indicators_user(void) {
|
||||
rgb_matrix_indicators_keymap();
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
return rgb_matrix_indicators_keymap();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue