Skip to content

Commit 62c7194

Browse files
committed
fix: webhid layer change not being fired when layer led are disabled
1 parent 06c04db commit 62c7194

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

keyboards/zsa/moonlander/moonlander.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ void keyboard_pre_init_kb(void) {
120120
layer_state_t layer_state_set_kb(layer_state_t state) {
121121
#if !defined(MOONLANDER_USER_LEDS)
122122
state = layer_state_set_user(state);
123-
if (is_launching || !keyboard_config.led_level) return state;
124-
#ifdef ORYX_ENABLE
123+
# ifdef ORYX_ENABLE
124+
layer_state_set_oryx(state);
125125
if (rawhid_state.status_led_control) return state;
126-
#endif
126+
# endif
127+
if (is_launching || !keyboard_config.led_level) return state;
127128
bool LED_1 = false;
128129
bool LED_2 = false;
129130
bool LED_3 = false;
@@ -172,9 +173,6 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
172173
#if !defined(CAPS_LOCK_STATUS)
173174
STATUS_LED_6(LED_6);
174175
#endif
175-
#endif
176-
#ifdef ORYX_ENABLE
177-
layer_state_set_oryx(state);
178176
#endif
179177

180178
return state;

keyboards/zsa/voyager/voyager.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,18 @@ void keyboard_pre_init_kb(void) {
9696
layer_state_t layer_state_set_kb(layer_state_t state) {
9797
state = layer_state_set_user(state);
9898
#if !defined(VOYAGER_USER_LEDS)
99-
if (is_launching || !keyboard_config.led_level) return state;
10099
# ifdef ORYX_ENABLE
100+
layer_state_set_oryx(state);
101101
if (rawhid_state.status_led_control) return state;
102102
# endif
103+
if (is_launching || !keyboard_config.led_level) return state;
103104
uint8_t layer = get_highest_layer(state);
104105
STATUS_LED_1(layer & (1 << 0));
105106
STATUS_LED_2(layer & (1 << 1));
106107
STATUS_LED_3(layer & (1 << 2));
107108
# if !defined(CAPS_LOCK_STATUS)
108109
STATUS_LED_4(layer & (1 << 3));
109110
# endif
110-
#endif
111-
#ifdef ORYX_ENABLE
112-
layer_state_set_oryx(state);
113111
#endif
114112
return state;
115113
}

0 commit comments

Comments
 (0)