Skip to content

Commit

Permalink
fix: webhid layer change not being fired when layer led are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
fdidron committed Sep 11, 2024
1 parent 06c04db commit 62c7194
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 4 additions & 6 deletions keyboards/zsa/moonlander/moonlander.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ void keyboard_pre_init_kb(void) {
layer_state_t layer_state_set_kb(layer_state_t state) {
#if !defined(MOONLANDER_USER_LEDS)
state = layer_state_set_user(state);
if (is_launching || !keyboard_config.led_level) return state;
#ifdef ORYX_ENABLE
# ifdef ORYX_ENABLE
layer_state_set_oryx(state);
if (rawhid_state.status_led_control) return state;
#endif
# endif
if (is_launching || !keyboard_config.led_level) return state;
bool LED_1 = false;
bool LED_2 = false;
bool LED_3 = false;
Expand Down Expand Up @@ -172,9 +173,6 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
#if !defined(CAPS_LOCK_STATUS)
STATUS_LED_6(LED_6);
#endif
#endif
#ifdef ORYX_ENABLE
layer_state_set_oryx(state);
#endif

return state;
Expand Down
6 changes: 2 additions & 4 deletions keyboards/zsa/voyager/voyager.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,18 @@ void keyboard_pre_init_kb(void) {
layer_state_t layer_state_set_kb(layer_state_t state) {
state = layer_state_set_user(state);
#if !defined(VOYAGER_USER_LEDS)
if (is_launching || !keyboard_config.led_level) return state;
# ifdef ORYX_ENABLE
layer_state_set_oryx(state);
if (rawhid_state.status_led_control) return state;
# endif
if (is_launching || !keyboard_config.led_level) return state;
uint8_t layer = get_highest_layer(state);
STATUS_LED_1(layer & (1 << 0));
STATUS_LED_2(layer & (1 << 1));
STATUS_LED_3(layer & (1 << 2));
# if !defined(CAPS_LOCK_STATUS)
STATUS_LED_4(layer & (1 << 3));
# endif
#endif
#ifdef ORYX_ENABLE
layer_state_set_oryx(state);
#endif
return state;
}
Expand Down

0 comments on commit 62c7194

Please sign in to comment.