1
0

Get rid of USB_LED_NUM_LOCK (#21424)

This commit is contained in:
Ryan
2023-07-03 04:35:41 +10:00
committed by GitHub
parent 7ff80a57cb
commit 9ab16e62f7
25 changed files with 91 additions and 133 deletions

View File

@@ -41,7 +41,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case NUMPAD:
if (record->event.pressed) {
layer_invert(L_NUMPAD);
bool num_lock = host_keyboard_leds() & 1<<USB_LED_NUM_LOCK;
bool num_lock = host_keyboard_led_state().num_lock;
if (num_lock != (bool)IS_LAYER_ON(L_NUMPAD)) {
tap_code(KC_NUM_LOCK); // Toggle Num Lock to match layer state.
}

View File

@@ -126,16 +126,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void matrix_init_user(void) {
if (!(host_keyboard_leds() & (1<<USB_LED_NUM_LOCK))) {
if (!host_keyboard_led_state().num_lock) {
register_code(KC_NUM_LOCK);
unregister_code(KC_NUM_LOCK);
}
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
rgblight_mode(18);
} else {
rgblight_mode(14);
}
return false;
}