diff --git a/keyboards/keychron/q1/q1.c b/keyboards/keychron/q1/q1.c index 59de398077..aa0258901b 100644 --- a/keyboards/keychron/q1/q1.c +++ b/keyboards/keychron/q1/q1.c @@ -17,6 +17,8 @@ #include "q1.h" #include "test.c" +#ifdef DIP_SWITCH_ENABLE + bool dip_switch_update_kb(uint8_t index, bool active) { if (!dip_switch_update_user(index, active)) { return false;} if (index == 0) { @@ -24,3 +26,23 @@ bool dip_switch_update_kb(uint8_t index, bool active) { } return true; } + +#endif + + +#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX) + +#define CAPS_LOCK_BRIGHTNESS 0xFF +#ifdef RGB_MATRIX_MAXIMUM_BRIGHTNESS + #undef CAPS_LOCK_BRIGHTNESS + #define CAPS_LOCK_BRIGHTNESS RGB_MATRIX_MAXIMUM_BRIGHTNESS +#endif + +__attribute__((weak)) +void rgb_matrix_indicators_user(void) { + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color(CAPS_LOCK_LED_INDEX, CAPS_LOCK_BRIGHTNESS, CAPS_LOCK_BRIGHTNESS, CAPS_LOCK_BRIGHTNESS); // white + } +} + +#endif diff --git a/keyboards/keychron/q1/q1_ansi_stm32l432_ec11/config.h b/keyboards/keychron/q1/q1_ansi_stm32l432_ec11/config.h index 034796c7f9..a879916787 100644 --- a/keyboards/keychron/q1/q1_ansi_stm32l432_ec11/config.h +++ b/keyboards/keychron/q1/q1_ansi_stm32l432_ec11/config.h @@ -59,3 +59,6 @@ /* Specifies the number of pulses the encoder registers between each detent */ #define ENCODER_RESOLUTION 4 + +/* Enable caps-lock LED */ +#define CAPS_LOCK_LED_INDEX 44