forked from kofal.net/zmk
fix: Properly calculate highest active layer for display.
This commit is contained in:
committed by
Pete Johanson
parent
de38676afd
commit
cca637d66e
@@ -36,7 +36,7 @@ struct output_status_state {
|
||||
};
|
||||
|
||||
struct layer_status_state {
|
||||
uint8_t index;
|
||||
zmk_keymap_layer_index_t index;
|
||||
const char *label;
|
||||
};
|
||||
|
||||
@@ -277,8 +277,9 @@ static void layer_status_update_cb(struct layer_status_state state) {
|
||||
}
|
||||
|
||||
static struct layer_status_state layer_status_get_state(const zmk_event_t *eh) {
|
||||
uint8_t index = zmk_keymap_highest_layer_active();
|
||||
return (struct layer_status_state){.index = index, .label = zmk_keymap_layer_name(index)};
|
||||
zmk_keymap_layer_index_t index = zmk_keymap_highest_layer_active();
|
||||
return (struct layer_status_state){
|
||||
.index = index, .label = zmk_keymap_layer_name(zmk_keymap_layer_index_to_id(index))};
|
||||
}
|
||||
|
||||
ZMK_DISPLAY_WIDGET_LISTENER(widget_layer_status, struct layer_status_state, layer_status_update_cb,
|
||||
|
||||
Reference in New Issue
Block a user