summaryrefslogtreecommitdiff
path: root/keyboards/helix/rev2/keymaps
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/helix/rev2/keymaps')
-rw-r--r--keyboards/helix/rev2/keymaps/edvorakjp/oled.c8
-rw-r--r--keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c8
-rw-r--r--keyboards/helix/rev2/keymaps/froggy/keymap.c14
-rw-r--r--keyboards/helix/rev2/keymaps/froggy_106/keymap.c14
-rw-r--r--keyboards/helix/rev2/keymaps/yshrsmz/keymap.c20
5 files changed, 30 insertions, 34 deletions
diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c
index 14e3e5533b..38a91c1639 100644
--- a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c
+++ b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c
@@ -5,13 +5,9 @@
#ifdef OLED_ENABLE
void render_host_led_state(void) {
char led_state_str[24];
- uint8_t leds = host_keyboard_leds();
+ led_t led_state = host_keyboard_led_state();
- bool is_num_lock_enabled = leds & (1 << USB_LED_NUM_LOCK);
- bool is_caps_lock_enabled = leds & (1 << USB_LED_CAPS_LOCK);
- bool is_scroll_lock_enabled = leds & (1 << USB_LED_SCROLL_LOCK);
-
- snprintf(led_state_str, sizeof(led_state_str), "NL:%s CL:%s SL:%s", is_num_lock_enabled ? "on" : "- ", is_caps_lock_enabled ? "on" : "- ", is_scroll_lock_enabled ? "on" : "- ");
+ snprintf(led_state_str, sizeof(led_state_str), "NL:%s CL:%s SL:%s", led_state.num_lock ? "on" : "- ", led_state.caps_lock ? "on" : "- ", led_state.scroll_lock ? "on" : "- ");
oled_write(led_state_str, false);
}
diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c
index 32b446c498..ff7b174f5b 100644
--- a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c
+++ b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c
@@ -205,7 +205,7 @@ const char code_to_name[60] = {
static inline void set_keylog(uint16_t keycode, keyrecord_t *record)
{
char name = ' ';
- uint8_t leds = host_keyboard_leds();
+ led_t led_state = host_keyboard_led_state();
if (keycode < 60)
{
@@ -218,9 +218,9 @@ static inline void set_keylog(uint16_t keycode, keyrecord_t *record)
record->event.key.col,
keycode,
name,
- (leds & (1<<USB_LED_NUM_LOCK)) ? 'N' : ' ',
- (leds & (1<<USB_LED_CAPS_LOCK)) ? 'C' : ' ',
- (leds & (1<<USB_LED_SCROLL_LOCK)) ? 'S' : ' '
+ led_state.num_lock ? 'N' : ' ',
+ led_state.caps_lock ? 'C' : ' ',
+ led_state.scroll_lock ? 'S' : ' '
);
}
#endif
diff --git a/keyboards/helix/rev2/keymaps/froggy/keymap.c b/keyboards/helix/rev2/keymaps/froggy/keymap.c
index 8463365f59..c29c5832de 100644
--- a/keyboards/helix/rev2/keymaps/froggy/keymap.c
+++ b/keyboards/helix/rev2/keymaps/froggy/keymap.c
@@ -704,9 +704,10 @@ void render_status(struct CharacterMatrix *matrix) {
int rows = 0;
//Set Indicator icon
- if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) { rown = 4; } else { rown = 0; }
- if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { rowa = 4; } else { rowa = 0; }
- if (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) { rows = 4; } else { rows = 0; }
+ led_t led_state = host_keyboard_led_state();
+ if (led_state.num_lock) { rown = 4; } else { rown = 0; }
+ if (led_state.caps_lock) { rowa = 4; } else { rowa = 0; }
+ if (led_state.scroll_lock) { rows = 4; } else { rows = 0; }
if (layer_state == L_FUNC) { rowf = 4; }
matrix_write(matrix, indctr[rown] [0]);
@@ -813,9 +814,10 @@ void render_status(void) {
int rows = 0;
//Set Indicator icon
- if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) { rown = 4; } else { rown = 0; }
- if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { rowa = 4; } else { rowa = 0; }
- if (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) { rows = 4; } else { rows = 0; }
+ led_t led_state = host_keyboard_led_state();
+ if (led_state.num_lock) { rown = 4; } else { rown = 0; }
+ if (led_state.caps_lock) { rowa = 4; } else { rowa = 0; }
+ if (led_state.scroll_lock) { rows = 4; } else { rows = 0; }
if (layer_state == L_FUNC) { rowf = 4; }
oled_write(indctr[rown] [0], false);
diff --git a/keyboards/helix/rev2/keymaps/froggy_106/keymap.c b/keyboards/helix/rev2/keymaps/froggy_106/keymap.c
index a370c21ea2..b9c6aa2324 100644
--- a/keyboards/helix/rev2/keymaps/froggy_106/keymap.c
+++ b/keyboards/helix/rev2/keymaps/froggy_106/keymap.c
@@ -782,9 +782,10 @@ void render_status(struct CharacterMatrix *matrix) {
int rowj = 1;
//Set Indicator icon
- if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) { rown = 4; }
- if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { rowa = 4; }
- if (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) { rows = 4; }
+ led_t led_state = host_keyboard_led_state();
+ if (led_state.num_lock) { rown = 4; }
+ if (led_state.caps_lock) { rowa = 4; }
+ if (led_state.scroll_lock) { rows = 4; }
if (IS_LAYER_ON(_FUNC)) { rowf = 4; }
//Set Mode icon
@@ -909,9 +910,10 @@ void render_status(void) {
int rowj = 1;
//Set Indicator icon
- if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) { rown = 4; }
- if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { rowa = 4; }
- if (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) { rows = 4; }
+ led_t led_state = host_keyboard_led_state();
+ if (led_state.num_lock) { rown = 4; }
+ if (led_state.caps_lock) { rowa = 4; }
+ if (led_state.scroll_lock) { rows = 4; }
if (IS_LAYER_ON(_FUNC)) { rowf = 4; }
//Set Mode icon
diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c
index b3ae8a3d25..1fc5dfba99 100644
--- a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c
+++ b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c
@@ -459,12 +459,10 @@ void render_status(struct CharacterMatrix *matrix) {
matrix_write_P(matrix, PSTR("\n"));
// Host Keyboard LED Status
- matrix_write_P(matrix, (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ?
- PSTR("NUMLOCK") : PSTR(" "));
- matrix_write_P(matrix, (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ?
- PSTR("CAPS") : PSTR(" "));
- matrix_write_P(matrix, (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ?
- PSTR("SCLK") : PSTR(" "));
+ led_t led_state = host_keyboard_led_state();
+ matrix_write_P(matrix, led_state.num_lock ? PSTR("NUMLOCK") : PSTR(" "));
+ matrix_write_P(matrix, led_state.caps_lock ? PSTR("CAPS") : PSTR(" "));
+ matrix_write_P(matrix, led_state.scroll_lock ? PSTR("SCLK") : PSTR(" "));
matrix_write_P(matrix, PSTR("\n"));
render_rgbled_status(true, matrix);
}
@@ -580,12 +578,10 @@ void render_status(void) {
render_layer_status();
// Host Keyboard LED Status
- oled_write_P((host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ?
- PSTR("NUMLOCK") : PSTR(" "), false);
- oled_write_P((host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ?
- PSTR("CAPS") : PSTR(" "), false);
- oled_write_P((host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ?
- PSTR("SCLK") : PSTR(" "), false);
+ led_t led_state = host_keyboard_led_state();
+ oled_write_P(led_state.num_lock ? PSTR("NUMLOCK") : PSTR(" "), false);
+ oled_write_P(led_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false);
+ oled_write_P(led_state.scroll_lock ? PSTR("SCLK") : PSTR(" "), false);
oled_write_P(PSTR("\n"), false);
render_rgbled_status(true);
oled_write_P(PSTR("\n"), false);