summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/40percentclub/gherkin/keymaps/default/keymap.c7
-rw-r--r--keyboards/contra/keymaps/maxr1998/keymap.c5
-rw-r--r--keyboards/crkbd/keymaps/rpbaptist/keymap.c6
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c13
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c25
-rw-r--r--keyboards/dztech/dz65rgb/keymaps/matthewrobo/keymap.c11
-rw-r--r--keyboards/handwired/arrow_pad/keymaps/default/keymap.c7
-rw-r--r--keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c7
-rw-r--r--keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c7
-rw-r--r--keyboards/input_club/infinity60/led.c52
-rw-r--r--keyboards/input_club/infinity60/led_controller.c5
-rw-r--r--keyboards/kbdfans/niu_mini/keymaps/tobias/keymap.c12
-rw-r--r--keyboards/kprepublic/jj40/keymaps/stevexyz/keymap.c5
-rw-r--r--keyboards/massdrop/alt/keymaps/jdelkins_ss/keymap.c3
-rw-r--r--keyboards/mt/mt980/keymaps/walker/keymap.c4
-rwxr-xr-xkeyboards/novelkeys/novelpad/keymaps/0xdec/keymap.c5
-rw-r--r--keyboards/salicylic_acid3/setta21/keymaps/salicylic/keymap.c6
-rw-r--r--keyboards/westfoxtrot/cypher/rev1/keymaps/kwer/keymap.c19
-rw-r--r--keyboards/xiudi/xd75/keymaps/billypython/keymap.c2
-rw-r--r--keyboards/xiudi/xd75/keymaps/boy_314/keymap.c7
-rw-r--r--keyboards/yosino58/keymaps/default/keymap.c5
-rw-r--r--keyboards/yosino58/keymaps/sakura/keymap.c5
22 files changed, 88 insertions, 130 deletions
diff --git a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c
index ab2a1fa1c1..f4d3032857 100644
--- a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c
+++ b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c
@@ -59,16 +59,17 @@ void keyboard_pre_init_user(void) {
setPinOutput(B0);
}
-void led_set_user(uint8_t usb_led) {
- if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
+bool led_update_user(led_t led_state) {
+ if (led_state.num_lock) {
writePinLow(D5);
} else {
writePinHigh(D5);
}
- if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
+ if (led_state.caps_lock) {
writePinLow(B0);
} else {
writePinHigh(B0);
}
+ return false;
}
diff --git a/keyboards/contra/keymaps/maxr1998/keymap.c b/keyboards/contra/keymaps/maxr1998/keymap.c
index 8a56c60746..0802a211f0 100644
--- a/keyboards/contra/keymaps/maxr1998/keymap.c
+++ b/keyboards/contra/keymaps/maxr1998/keymap.c
@@ -176,10 +176,11 @@ void update_tri_layer_user(void) {
}
}
-void led_set_user(uint8_t usb_led) {
+bool led_update_user(led_t led_state) {
// Force-enable Numlock
- if (!(usb_led & (1<<USB_LED_NUM_LOCK))) {
+ if (!led_state.num_lock) {
register_code(KC_NUM_LOCK);
unregister_code(KC_NUM_LOCK);
}
+ return false;
}
diff --git a/keyboards/crkbd/keymaps/rpbaptist/keymap.c b/keyboards/crkbd/keymaps/rpbaptist/keymap.c
index aeeae2cbd8..0fc110b12e 100644
--- a/keyboards/crkbd/keymaps/rpbaptist/keymap.c
+++ b/keyboards/crkbd/keymaps/rpbaptist/keymap.c
@@ -266,10 +266,10 @@ void render_status(void) {
oled_write_P(PSTR("\n"), false);
- uint8_t led_usb_state = host_keyboard_leds();
+ led_t led_state = host_keyboard_led_state();
oled_write_P(PSTR("Mode:"), false);
- oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR(" NUM ") : PSTR("\n"), false);
- oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR(" CAPS") : PSTR("\n"), false);
+ oled_write_P(led_state.num_lock ? PSTR(" NUM ") : PSTR("\n"), false);
+ oled_write_P(led_state.caps_lock ? PSTR(" CAPS") : PSTR("\n"), false);
# ifdef RGB_MATRIX_ENABLE
oled_write_P(PSTR("\n"), false);
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;
-}
diff --git a/keyboards/dztech/dz65rgb/keymaps/matthewrobo/keymap.c b/keyboards/dztech/dz65rgb/keymaps/matthewrobo/keymap.c
index d283d0ba1e..7936aaff75 100644
--- a/keyboards/dztech/dz65rgb/keymaps/matthewrobo/keymap.c
+++ b/keyboards/dztech/dz65rgb/keymaps/matthewrobo/keymap.c
@@ -25,7 +25,6 @@ enum dz65rgb_keycodes {
#define TG_NKRO MAGIC_TOGGLE_NKRO
#define _V_V_V_ KC_TRNS
#define LT_CAPS LT(_NAV, KC_CAPS)
-extern bool autoshift_enabled;
#define MT_APP RALT_T(KC_APP)
#define LM_LALT LM(_FNM, MOD_LALT)
@@ -87,12 +86,12 @@ bool rgb_matrix_indicators_user(void) {
rgb_matrix_set_color(8, 0xFF, 0xFF, 0xFF);
}
- 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 (IS_LED_ON(this_led, USB_LED_NUM_LOCK)) {
+ if (led_state.num_lock) {
rgb_matrix_set_color(17, 0xFF, 0x00, 0x00);
rgb_matrix_set_color(26, 0xFF, 0xFF, 0x00);
} else {
@@ -171,12 +170,6 @@ bool rgb_matrix_indicators_user(void) {
rgb_matrix_set_color(24, 0xFF, 0x40, 0x00); // KC_MPRV
rgb_matrix_set_color(25, 0xFF, 0x40, 0x00);
- if (this_led & (1 << !autoshift_enabled)) {
- rgb_matrix_set_color(15, 0xFF, 0x00, 0x00); // AS_TOGG
- } else {
- rgb_matrix_set_color(15, 0xFF, 0xFF, 0x00);
- }
-
rgb_matrix_set_color(6, 0xFF, 0x80, 0x00); //RGB_MOD
rgb_matrix_set_color(48, 0xFF, 0x80, 0x00);
rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); //RGB_MOD
diff --git a/keyboards/handwired/arrow_pad/keymaps/default/keymap.c b/keyboards/handwired/arrow_pad/keymaps/default/keymap.c
index cecaefe80d..820851f803 100644
--- a/keyboards/handwired/arrow_pad/keymaps/default/keymap.c
+++ b/keyboards/handwired/arrow_pad/keymaps/default/keymap.c
@@ -96,9 +96,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
return true;
}
-void led_set_user(uint8_t usb_led)
+bool led_update_user(led_t led_state)
{
- if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+ if (led_state.caps_lock) {
// output high
DDRD |= (1<<6);
PORTD |= (1<<6);
@@ -107,7 +107,7 @@ void led_set_user(uint8_t usb_led)
DDRD &= ~(1<<6);
PORTD &= ~(1<<6);
}
- if (usb_led & (1<<USB_LED_NUM_LOCK)) {
+ if (led_state.num_lock) {
// output low
DDRC |= (1<<7);
PORTC |= ~(1<<7);
@@ -116,4 +116,5 @@ void led_set_user(uint8_t usb_led)
DDRC &= ~(1<<7);
PORTC &= ~(1<<7);
}
+ return false;
}
diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c b/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c
index cf291c00cf..c3ab462ce3 100644
--- a/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c
+++ b/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c
@@ -109,9 +109,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
return true;
}
-void led_set_user(uint8_t usb_led)
+bool led_update_user(led_t led_state)
{
- if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+ if (led_state.caps_lock) {
// output high
DDRD |= (1<<6);
PORTD |= (1<<6);
@@ -120,7 +120,7 @@ void led_set_user(uint8_t usb_led)
DDRD &= ~(1<<6);
PORTD &= ~(1<<6);
}
- if (usb_led & (1<<USB_LED_NUM_LOCK)) {
+ if (led_state.num_lock) {
// output low
DDRC |= (1<<7);
PORTC |= ~(1<<7);
@@ -129,4 +129,5 @@ void led_set_user(uint8_t usb_led)
DDRC &= ~(1<<7);
PORTC &= ~(1<<7);
}
+ return false;
}
diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c b/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c
index b69d49b7e5..fc044a0e1a 100644
--- a/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c
+++ b/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c
@@ -96,9 +96,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
return true;
}
-void led_set_user(uint8_t usb_led)
+bool led_update_user(led_t led_state)
{
- if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+ if (led_state.caps_lock) {
// output high
DDRD |= (1<<6);
PORTD |= (1<<6);
@@ -107,7 +107,7 @@ void led_set_user(uint8_t usb_led)
DDRD &= ~(1<<6);
PORTD &= ~(1<<6);
}
- if (usb_led & (1<<USB_LED_NUM_LOCK)) {
+ if (led_state.num_lock) {
// output low
DDRC |= (1<<7);
PORTC |= ~(1<<7);
@@ -116,4 +116,5 @@ void led_set_user(uint8_t usb_led)
DDRC &= ~(1<<7);
PORTC &= ~(1<<7);
}
+ return false;
}
diff --git a/keyboards/input_club/infinity60/led.c b/keyboards/input_club/infinity60/led.c
index 8effcea81a..33871bcc49 100644
--- a/keyboards/input_club/infinity60/led.c
+++ b/keyboards/input_club/infinity60/led.c
@@ -26,29 +26,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* both regular threads and ISRs, unlocked (during resume-from-sleep).
* In particular, I2C functions (interrupt-driven) should NOT be called from here.
*/
-void led_set(uint8_t usb_led) {
- msg_t msg;
-
- if (usb_led & (1<<USB_LED_NUM_LOCK)) {
- chSysUnconditionalLock();
- msg=(1 << 8) | TOGGLE_NUM_LOCK;
- chMBPostI(&led_mailbox, msg);
- chSysUnconditionalUnlock();
- } else {
- chSysUnconditionalLock();
- msg=(0 << 8) | TOGGLE_NUM_LOCK;
- chMBPostI(&led_mailbox, msg);
- chSysUnconditionalUnlock();
- }
- if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
- chSysUnconditionalLock();
- msg=(1 << 8) | TOGGLE_CAPS_LOCK;
- chMBPostI(&led_mailbox, msg);
- chSysUnconditionalUnlock();
- } else {
- chSysUnconditionalLock();
- msg=(0 << 8) | TOGGLE_CAPS_LOCK;
- chMBPostI(&led_mailbox, msg);
- chSysUnconditionalUnlock();
+bool led_update_kb(led_t led_state) {
+ bool res = led_update_user(led_state);
+ if (res) {
+ msg_t msg;
+
+ if (led_state.num_lock) {
+ chSysUnconditionalLock();
+ msg=(1 << 8) | TOGGLE_NUM_LOCK;
+ chMBPostI(&led_mailbox, msg);
+ chSysUnconditionalUnlock();
+ } else {
+ chSysUnconditionalLock();
+ msg=(0 << 8) | TOGGLE_NUM_LOCK;
+ chMBPostI(&led_mailbox, msg);
+ chSysUnconditionalUnlock();
+ }
+ if (led_state.caps_lock) {
+ chSysUnconditionalLock();
+ msg=(1 << 8) | TOGGLE_CAPS_LOCK;
+ chMBPostI(&led_mailbox, msg);
+ chSysUnconditionalUnlock();
+ } else {
+ chSysUnconditionalLock();
+ msg=(0 << 8) | TOGGLE_CAPS_LOCK;
+ chMBPostI(&led_mailbox, msg);
+ chSysUnconditionalUnlock();
+ }
}
+ return false;
}
diff --git a/keyboards/input_club/infinity60/led_controller.c b/keyboards/input_club/infinity60/led_controller.c
index cf3edf20dd..5ea0ae804c 100644
--- a/keyboards/input_club/infinity60/led_controller.c
+++ b/keyboards/input_club/infinity60/led_controller.c
@@ -187,8 +187,9 @@ static THD_FUNCTION(LEDthread, arg) {
// initialize persistent variables
pwm_step_status = 4; //full brightness
page_status = 0; //start frame 0 (all off/on)
- numlock_status = (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? 1 : 0;
- capslock_status = (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? 1 : 0;
+ led_t led_state = host_keyboard_led_state();
+ numlock_status = led_state.num_lock ? 1 : 0;
+ capslock_status = led_state.caps_lock ? 1 : 0;
while(true) {
// wait for a message (asynchronous)
diff --git a/keyboards/kbdfans/niu_mini/keymaps/tobias/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/tobias/keymap.c
index 4224672152..8c7d3b8e0e 100644
--- a/keyboards/kbdfans/niu_mini/keymaps/tobias/keymap.c
+++ b/keyboards/kbdfans/niu_mini/keymaps/tobias/keymap.c
@@ -377,13 +377,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
*/
-void led_set_user(uint8_t usb_led) {
-
- if (usb_led & (1 << USB_LED_NUM_LOCK)) {
- bnumlock = true;
-
- } else {
- bnumlock = false;
- }
-
+bool led_update_user(led_t led_state) {
+ bnumlock = led_state.num_lock;
+ return false;
}
diff --git a/keyboards/kprepublic/jj40/keymaps/stevexyz/keymap.c b/keyboards/kprepublic/jj40/keymaps/stevexyz/keymap.c
index 51691e8f1f..6c8220a702 100644
--- a/keyboards/kprepublic/jj40/keymaps/stevexyz/keymap.c
+++ b/keyboards/kprepublic/jj40/keymaps/stevexyz/keymap.c
@@ -262,14 +262,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void matrix_init_user(void) {
// eeconfig_init(); // reset keyboard to a standard default state; useful when new releases messup with eeprom values
// set num lock on at start (for numonly layer to work)
- if (!(host_keyboard_leds() & (1<<USB_LED_NUM_LOCK))) {
+ if (!host_keyboard_led_state().num_lock) {
SEND_STRING(SS_TAP(X_NUM_LOCK)); //register_code(KC_NUM_LOCK); unregister_code(KC_NUM_LOCK);
}
}
-void matrix_scan_user(void) {
-}
-
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case CK_TRIPLEZERO:
diff --git a/keyboards/massdrop/alt/keymaps/jdelkins_ss/keymap.c b/keyboards/massdrop/alt/keymaps/jdelkins_ss/keymap.c
index 51772f1fa3..c974fb9e2b 100644
--- a/keyboards/massdrop/alt/keymaps/jdelkins_ss/keymap.c
+++ b/keyboards/massdrop/alt/keymaps/jdelkins_ss/keymap.c
@@ -26,7 +26,6 @@ uint16_t rgb_idle_seconds = 0;
uint16_t rgb_timer;
uint8_t save_layer;
-#define NUMLOCK_ON (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK))
#define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT)
#define MODS_CTRL (get_mods() & MOD_MASK_CTRL)
@@ -143,7 +142,7 @@ static void set_rgb_layer(int layer) {
void matrix_init_keymap(void) {
set_rgb_layer(_QWERTY);
// force numlock on upon startup
- if (!NUMLOCK_ON) {
+ if (!host_keyboard_led_state().num_lock) {
tap_code(KC_NUM_LOCK);
}
};
diff --git a/keyboards/mt/mt980/keymaps/walker/keymap.c b/keyboards/mt/mt980/keymaps/walker/keymap.c
index e98a1d71de..f0817dd33d 100644
--- a/keyboards/mt/mt980/keymaps/walker/keymap.c
+++ b/keyboards/mt/mt980/keymaps/walker/keymap.c
@@ -89,8 +89,8 @@ tap_dance_action_t tap_dance_actions[] = {
[ALT_L1] = ACTION_TAP_DANCE_FN_ADVANCED(NULL,alt_finished, alt_reset)
};
-void led_set_keymap(uint8_t usb_led) {
- if (usb_led & (1<<USB_LED_NUM_LOCK)) {
+bool led_update_keymap(led_t led_state) {
+ if (led_state.num_lock) {
numlock_on = true;
}
else {
diff --git a/keyboards/novelkeys/novelpad/keymaps/0xdec/keymap.c b/keyboards/novelkeys/novelpad/keymaps/0xdec/keymap.c
index 5380de9648..79a3e2fdbf 100755
--- a/keyboards/novelkeys/novelpad/keymaps/0xdec/keymap.c
+++ b/keyboards/novelkeys/novelpad/keymaps/0xdec/keymap.c
@@ -36,11 +36,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
-void led_set_user(uint8_t usb_led) {
- if (usb_led & (1 << USB_LED_NUM_LOCK)) {
+bool led_update_user(led_t led_state) {
+ if (led_state.num_lock) {
// Illuminate the LED under the Num Lock key
rgblight_sethsv_at(0, 0, 127, 1);
} else {
rgblight_sethsv_at(0, 0, 0, 1);
}
+ return false;
}
diff --git a/keyboards/salicylic_acid3/setta21/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/setta21/keymaps/salicylic/keymap.c
index e117d26eee..b7cde4d4e0 100644
--- a/keyboards/salicylic_acid3/setta21/keymaps/salicylic/keymap.c
+++ b/keyboards/salicylic_acid3/setta21/keymaps/salicylic/keymap.c
@@ -173,8 +173,8 @@ void render_layer_state(void) {
oled_write_P(PSTR(" Macro "), layer_state_is(_MACRO));
}
-void render_keylock_status(uint8_t led_usb_state) {
- oled_write_P(PSTR("NumLock"), led_usb_state & (1 << USB_LED_NUM_LOCK));
+void render_keylock_status(led_t led_state) {
+ oled_write_P(PSTR("NumLock"), led_state.num_lock);
oled_write_P(PSTR(" "), false);
}
@@ -186,7 +186,7 @@ void render_layer_messages(void) {
void render_status(void) {
/* Show Keyboard Layout */
render_layer_messages();
- render_keylock_status(host_keyboard_leds());
+ render_keylock_status(host_keyboard_led_state());
render_layer_state();
}
diff --git a/keyboards/westfoxtrot/cypher/rev1/keymaps/kwer/keymap.c b/keyboards/westfoxtrot/cypher/rev1/keymaps/kwer/keymap.c
index eed5e664a8..9763abe369 100644
--- a/keyboards/westfoxtrot/cypher/rev1/keymaps/kwer/keymap.c
+++ b/keyboards/westfoxtrot/cypher/rev1/keymaps/kwer/keymap.c
@@ -51,23 +51,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
-
-
-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;
-}
-
-void led_set_user(uint8_t usb_led) {
+bool led_update_user(led_t led_state) {
// Insert custom handling for CAPS_LOCK, NUM_LOCK, SCROLL_LOCK here
- if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
+ if (led_state.num_lock) {
writePinHigh(F4);
writePinHigh(F1);
writePinHigh(F5);
@@ -76,4 +62,5 @@ void led_set_user(uint8_t usb_led) {
writePinLow(F1);
writePinLow(F5);
}
+ return false;
}
diff --git a/keyboards/xiudi/xd75/keymaps/billypython/keymap.c b/keyboards/xiudi/xd75/keymaps/billypython/keymap.c
index 30b9f79606..d8301194f8 100644
--- a/keyboards/xiudi/xd75/keymaps/billypython/keymap.c
+++ b/keyboards/xiudi/xd75/keymaps/billypython/keymap.c
@@ -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.
}
diff --git a/keyboards/xiudi/xd75/keymaps/boy_314/keymap.c b/keyboards/xiudi/xd75/keymaps/boy_314/keymap.c
index 1c5aa90627..1f3897f484 100644
--- a/keyboards/xiudi/xd75/keymaps/boy_314/keymap.c
+++ b/keyboards/xiudi/xd75/keymaps/boy_314/keymap.c
@@ -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;
}
diff --git a/keyboards/yosino58/keymaps/default/keymap.c b/keyboards/yosino58/keymaps/default/keymap.c
index 45ee46f7ce..512c0ec4b1 100644
--- a/keyboards/yosino58/keymaps/default/keymap.c
+++ b/keyboards/yosino58/keymaps/default/keymap.c
@@ -200,8 +200,9 @@ bool oled_task_user(void) {
int rowa = 0;
//Set Indicator icon
- if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) { rown = 1; } else { rown = 0; }
- if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { rowc = 1; } else { rowc = 0; }
+ led_t led_state = host_keyboard_led_state();
+ if (led_state.num_lock) { rown = 1; } else { rown = 0; }
+ if (led_state.caps_lock) { rowc = 1; } else { rowc = 0; }
if (layer_state == L_LOWER) { rowl = 1; }
if (layer_state == L_RAISE) { rowr = 1; }
if (layer_state == L_ADJUST) { rowa = 1; }
diff --git a/keyboards/yosino58/keymaps/sakura/keymap.c b/keyboards/yosino58/keymaps/sakura/keymap.c
index 53d4f9b077..e3c8c52d7d 100644
--- a/keyboards/yosino58/keymaps/sakura/keymap.c
+++ b/keyboards/yosino58/keymaps/sakura/keymap.c
@@ -200,8 +200,9 @@ bool oled_task_user(void) {
int rowa = 0;
//Set Indicator icon
- if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) { rown = 1; } else { rown = 0; }
- if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { rowc = 1; } else { rowc = 0; }
+ led_t led_state = host_keyboard_led_state();
+ if (led_state.num_lock) { rown = 1; } else { rown = 0; }
+ if (led_state.caps_lock) { rowc = 1; } else { rowc = 0; }
if (layer_state == L_LOWER) { rowl = 1; }
if (layer_state == L_RAISE) { rowr = 1; }
if (layer_state == L_ADJUST) { rowa = 1; }