Get rid of USB_LED_SCROLL_LOCK (#21405)

This commit is contained in:
Ryan 2023-07-03 04:24:22 +10:00 committed by GitHub
parent 9dbad1fa5c
commit 7ff80a57cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 399 additions and 479 deletions

View file

@ -3,8 +3,6 @@
#define MEDAPP LT(MEDIA, KC_APP)
uint8_t current_layer_global = 255;
enum layers {
DEFAULT,
PROG1,
@ -87,25 +85,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______,_______, LT(MISC, KC_SPC), _______,_______,_______,_______, _______,_______,_______, _______,_______),
};
void matrix_scan_user(void) {
uint8_t layer;
layer = get_highest_layer(layer_state);
if (current_layer_global != layer) {
current_layer_global = layer;
// unset CAPSLOCK and SCROLL LOCK LEDs
led_set(host_keyboard_leds() & ~(1<<USB_LED_CAPS_LOCK));
led_set(host_keyboard_leds() & ~(1<<USB_LED_SCROLL_LOCK));
// set SCROLL LOCK LED when the mouse layer is active, CAPS LOCK when PROG layer is active
if (layer == MOUSE1 || layer == MOUSE2) {
led_set(host_keyboard_leds() | (1<<USB_LED_SCROLL_LOCK));
} else if (layer == PROG1 || layer == PROG2) {
led_set(host_keyboard_leds() | (1<<USB_LED_CAPS_LOCK));
}
}
}
void tap_helper(keyrecord_t *record, uint16_t orig_mod, uint16_t macro_mod, uint16_t macro_kc ) {
if (record->event.pressed) {
if (record->tap.count > 0 && !record->tap.interrupted) {