From 9ab16e62f75dc6228549ec0aba00ec0704bbc779 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 3 Jul 2023 04:35:41 +1000 Subject: Get rid of `USB_LED_NUM_LOCK` (#21424) --- .../dztech/dz60rgb/keymaps/matthewrobo/keymap.c | 13 +++-------- keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c | 25 +++------------------- 2 files changed, 6 insertions(+), 32 deletions(-) (limited to 'keyboards/dztech/dz60rgb/keymaps') diff --git a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c index 8d58eed10e..e446178b62 100644 --- a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c @@ -25,7 +25,6 @@ enum dz60rgb_keycodes { #define _V_V_V_ KC_TRNS #define LT_CAPS LT(_NAV, KC_CAPS) #define LT_DEL LT(_RGB, KC_DEL) -extern bool autoshift_enabled; #define MT_SLSH RSFT_T(KC_SLSH) #define MT_APP RALT_T(KC_APP) #define LM_LALT LM(_FNM, MOD_LALT) @@ -92,12 +91,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; bool rgb_matrix_indicators_user(void) { - uint8_t this_led = host_keyboard_leds(); + led_t led_state = host_keyboard_led_state(); if (!g_suspend_state && rgb_matrix_config.enable) { switch (get_highest_layer(layer_state)) { case _NAV: - if (this_led & (1 << USB_LED_NUM_LOCK)) { + if (led_state.num_lock) { rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); rgb_matrix_set_color(19, 0xFF, 0xFF, 0x00); } else { @@ -204,17 +203,11 @@ bool rgb_matrix_indicators_user(void) { rgb_matrix_set_color(41, 0xFF, 0x00, 0x40); // ctrl+delete rgb_matrix_set_color(43, 0xFF, 0x00, 0x40); // ctrl+slash - if (this_led & (1 << !autoshift_enabled)) { - rgb_matrix_set_color(0, 0xFF, 0x00, 0x00); // AS_TOGG - } else { - rgb_matrix_set_color(0, 0xFF, 0xFF, 0x00); - } - break; } } - if (this_led & (1 << USB_LED_CAPS_LOCK)) { + if (led_state.caps_lock) { rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); } return false; diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c index 4dca4d2396..52b7643850 100644 --- a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c @@ -58,7 +58,7 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { } bool rgb_matrix_indicators_user(void) { - uint8_t this_led = host_keyboard_leds(); + led_t led_state = host_keyboard_led_state(); if (!g_suspend_state && rgb_matrix_config.enable) { switch (get_highest_layer(layer_state)) { @@ -73,13 +73,13 @@ bool rgb_matrix_indicators_user(void) { } } - if (this_led & (1 << USB_LED_CAPS_LOCK)) { + if (led_state.caps_lock) { rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); } switch (get_highest_layer(layer_state)) { case _LAYER3: - if (this_led & (1 << USB_LED_NUM_LOCK)) { + if (led_state.num_lock) { rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); } else { rgb_matrix_set_color(13, 0x00, 0x00, 0x00); @@ -152,22 +152,3 @@ bool rgb_matrix_indicators_user(void) { } return false; } - - - - - -void matrix_init_user(void) -{ - //user initialization -} - -void matrix_scan_user(void) -{ - //user matrix -} - -bool process_record_user(uint16_t keycode, keyrecord_t* record) -{ - return true; -} -- cgit v1.2.3