Hide momentary layers in Zen layer widget
This commit is contained in:
parent
9ef1605b7c
commit
be4a3101de
2 changed files with 14 additions and 0 deletions
|
@ -27,6 +27,16 @@ static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) {
|
|||
const char *layer_label = state.label;
|
||||
uint8_t active_layer_index = state.index;
|
||||
|
||||
#if IS_ENABLED(CONFIG_ZMK_DISPLAY_HIDE_MOMENTARY_LAYERS)
|
||||
static uint8_t last_perm_index = 255;
|
||||
if (!zmk_keymap_layer_momentary(active_layer_index) && last_perm_index != active_layer_index) {
|
||||
last_perm_index = active_layer_index;
|
||||
LOG_DBG("Last perm layer index updated to %i", active_layer_index);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (layer_label == NULL) {
|
||||
char text[6] = {};
|
||||
|
||||
|
|
|
@ -183,6 +183,10 @@ config ZMK_DISPLAY_FULL_REFRESH_PERIOD
|
|||
Period in seconds for how often to completely refresh/redraw the whole screen.
|
||||
Most useful for e-ink/EPD displays that require occasional full redraws.
|
||||
|
||||
config ZMK_DISPLAY_HIDE_MOMENTARY_LAYERS
|
||||
bool "Do not update layer widget for momentary layer changes"
|
||||
default n
|
||||
|
||||
rsource "widgets/Kconfig"
|
||||
|
||||
endif
|
||||
|
|
Loading…
Add table
Reference in a new issue