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:
@@ -230,7 +230,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
void rgb_matrix_indicators_user(void) {
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
|
||||
// CapsLock Light
|
||||
if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
|
||||
@@ -239,4 +239,5 @@ void rgb_matrix_indicators_user(void) {
|
||||
|
||||
// Show Selected Layer
|
||||
rgb_matrix_set_color(layers_leds_map[get_highest_layer(layer_state)], MAIN_COLOR[0], MAIN_COLOR[1], MAIN_COLOR[2]);
|
||||
return false;
|
||||
}
|
||||
|
@@ -134,7 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
//**************** MATRIX SCANS *********************//
|
||||
|
||||
void rgb_matrix_indicators_user(void) {
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
||||
@@ -192,6 +192,7 @@ void rgb_matrix_indicators_user(void) {
|
||||
}
|
||||
|
||||
#endif /* RGB_MATRIX */
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@@ -82,8 +82,7 @@ CPS, A, S, D, F, G, H, J, K, L, COL, QOT, RETURN, +
|
||||
SFT, Z, X, C, V, B, N, M, COM, DOT, SLS, SHIFT, UP, 0
|
||||
CTL, GUI, ALT, SPACEBAR, ALT, FN, CTL, LFT, DWN, RIT
|
||||
*/
|
||||
void rgb_matrix_indicators_user(void)
|
||||
{
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
|
||||
rgb_matrix_set_color(8, 0xFF, 0xFF, 0xFF);
|
||||
}
|
||||
@@ -208,16 +207,7 @@ void rgb_matrix_indicators_user(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_init_user(void)
|
||||
{
|
||||
//user initialization
|
||||
}
|
||||
|
||||
void matrix_scan_user(void)
|
||||
{
|
||||
//user matrix
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t* record)
|
||||
|
@@ -1,17 +1,17 @@
|
||||
/* Copyright 2021 Yuannan (https://github.com/yuannan)
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* 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 QMK_KEYBOARD_H
|
||||
@@ -169,7 +169,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record){
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
@@ -179,20 +179,21 @@ RGB get_inverted_RGB(void){
|
||||
current_HSV.h = 255 - current_HSV.h;
|
||||
current_HSV.s = 255;
|
||||
current_HSV.v = 255;
|
||||
|
||||
|
||||
return hsv_to_rgb(current_HSV);
|
||||
}
|
||||
|
||||
// Move Caps indicator to the ctrl key where it belongs
|
||||
void rgb_matrix_indicators_user(void){
|
||||
bool rgb_matrix_indicators_user(void){
|
||||
RGB inverted_RGB = get_inverted_RGB();
|
||||
if (host_keyboard_led_state().caps_lock){
|
||||
rgb_matrix_set_color(58, inverted_RGB.r, inverted_RGB.g, inverted_RGB.b);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// show coloured indicator for layers with a keybind
|
||||
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 layer = get_highest_layer(layer_state);
|
||||
if (layer > 0) {
|
||||
RGB inverted_RGB = get_inverted_RGB();
|
||||
@@ -207,4 +208,5 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max){
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user