mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-12-24 18:25:01 +06:00
Merge pull request #5 from keychron-contrib/vr-q1-add-caps-lock-light
[Q1] add caps lock indicator
This commit is contained in:
commit
955488a679
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user