From 87b11345a55d076966846d87b60d0f315b8bb984 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 6 Jul 2023 18:48:02 +1000 Subject: Get rid of `USB_LED_CAPS_LOCK` (#21436) --- .../community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c | 5 +++-- layouts/community/ergodox/colemak_code_friendly/keymap.c | 8 +++----- layouts/community/ergodox/drashna/keymap.c | 8 ++++---- layouts/community/ergodox/jjerrell/keymap.c | 4 ++-- layouts/community/ergodox/ordinary/keymap.c | 2 +- layouts/community/ergodox/ordinary_osx/keymap.c | 2 +- layouts/community/ergodox/osx_neo2/keymap.c | 7 +------ layouts/community/ergodox/software_neo2/keymap.c | 2 +- layouts/community/ergodox/swedish-lindhe/keymap.c | 7 +------ layouts/community/ortho_4x12/brandonschlack/keymap.c | 5 +++-- layouts/community/ortho_4x12/drashna/keymap.c | 4 ++-- 11 files changed, 22 insertions(+), 32 deletions(-) (limited to 'layouts') diff --git a/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c b/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c index 3af6af5091..37e459893c 100644 --- a/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c +++ b/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c @@ -109,9 +109,9 @@ void update_led(void) { } } -void led_set_user(uint8_t usb_led) { +bool led_update_user(led_t led_state) { // Caps Lock Indicator - if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + if (led_state.caps_lock) { writePinLow(B2); rgblight_setrgb(255, 110, 0); } @@ -133,6 +133,7 @@ void led_set_user(uint8_t usb_led) { } update_led(); } + return false; } layer_state_t layer_state_set_user(layer_state_t state) { diff --git a/layouts/community/ergodox/colemak_code_friendly/keymap.c b/layouts/community/ergodox/colemak_code_friendly/keymap.c index ae5bdcc5b8..d9e3c9fa61 100644 --- a/layouts/community/ergodox/colemak_code_friendly/keymap.c +++ b/layouts/community/ergodox/colemak_code_friendly/keymap.c @@ -310,9 +310,6 @@ void matrix_init_user(void) { void matrix_scan_user(void) { uint8_t layer = get_highest_layer(layer_state); - //led 1, RED, Caps-Lock ON - //if (host_keyboard_leds() & (1<mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || host_keyboard_led_state().caps_lock) { ergodox_right_led_1_on(); } else { ergodox_right_led_1_off(); diff --git a/layouts/community/ergodox/ordinary_osx/keymap.c b/layouts/community/ergodox/ordinary_osx/keymap.c index f67a6d6da0..3de64f4994 100644 --- a/layouts/community/ergodox/ordinary_osx/keymap.c +++ b/layouts/community/ergodox/ordinary_osx/keymap.c @@ -238,7 +238,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Runs constantly in the background, in a loop. void matrix_scan_user(void) { // shift or caps lock turns on red light - if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || host_keyboard_led_state().caps_lock) { ergodox_right_led_1_on(); } else { ergodox_right_led_1_off(); diff --git a/layouts/community/ergodox/osx_neo2/keymap.c b/layouts/community/ergodox/osx_neo2/keymap.c index 5b279073cc..079a92a97e 100644 --- a/layouts/community/ergodox/osx_neo2/keymap.c +++ b/layouts/community/ergodox/osx_neo2/keymap.c @@ -686,7 +686,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if ((capslock_state & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) { // CAPSLOCK is currently active, disable it - if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { + if (host_keyboard_led_state().caps_lock) { unregister_code(KC_LOCKING_CAPS_LOCK); } else { register_code(KC_LOCKING_CAPS_LOCK); @@ -697,11 +697,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return process_record_user_shifted(keycode, record); }; -// Runs just one time when the keyboard initializes. -void matrix_init_user(void){ - -}; - // Runs constantly in the background, in a loop. void matrix_scan_user(void) { uint8_t layer = get_highest_layer(layer_state); diff --git a/layouts/community/ergodox/software_neo2/keymap.c b/layouts/community/ergodox/software_neo2/keymap.c index c191a034f2..1c68a68b0f 100644 --- a/layouts/community/ergodox/software_neo2/keymap.c +++ b/layouts/community/ergodox/software_neo2/keymap.c @@ -106,7 +106,7 @@ void matrix_scan_user(void) { ergodox_right_led_3_off(); ergodox_board_led_off(); - if (host_keyboard_leds() & (1<