Add caps lock indication
This commit is contained in:
parent
cea5568fa6
commit
dba23759aa
Binary file not shown.
|
@ -1,5 +1,7 @@
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define CAPS_LOCK_LED_ID 30
|
||||||
|
|
||||||
enum alt_keycodes {
|
enum alt_keycodes {
|
||||||
U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
|
U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
|
||||||
U_T_AGCR, //USB Toggle Automatic GCR control
|
U_T_AGCR, //USB Toggle Automatic GCR control
|
||||||
|
@ -42,8 +44,15 @@ void matrix_scan_user(void) {
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
static uint32_t key_timer;
|
static uint32_t key_timer;
|
||||||
|
static bool caps_state;
|
||||||
|
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
|
case KC_CAPSLOCK:
|
||||||
|
if (caps_state) {
|
||||||
|
rgb_matrix_set_color(CAPS_LOCK_LED_ID, 255, 255, 255);
|
||||||
|
}
|
||||||
|
caps_state = !caps_state;
|
||||||
|
return true;
|
||||||
case U_T_AUTO:
|
case U_T_AUTO:
|
||||||
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
||||||
TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
|
TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
|
||||||
|
|
Loading…
Reference in a new issue