Fix inconsistent layer indicator (#579)

master
Raheman Vaiya 2 years ago
parent 0fde36e622
commit c19c64f471
  1. BIN
      data/keyd-application-mapper.1.gz
  2. BIN
      data/keyd.1.gz
  3. 5
      docs/keyd.scdoc
  4. 10
      src/daemon.c

Binary file not shown.

Binary file not shown.

@ -547,7 +547,10 @@ any of the following options:
*macro_repeat_timeout:* The time separating successive executions of a macro.
(default: 50)
*layer_indicator:* If set, this will turn the capslock light on whenever a layer is active.
*layer_indicator:* If set, this will turn the capslock light on whenever a layer is active.
Note: Some wayland compositors will aggressively toggle LED state rendering this option
unusable.
(default: 0)
*macro_sequence_timeout:* If set, this will add a timeout (*in

@ -85,9 +85,17 @@ static void on_layer_change(const struct keyboard *kbd, const char *name, uint8_
size_t n = 0;
if (kbd->config.layer_indicator) {
int active_layers = 0;
for (i = 1; i < kbd->config.nr_layers; i++)
if (kbd->config.layers[i].type != LT_LAYOUT && kbd->layer_state[i].active) {
active_layers = 1;
break;
}
for (i = 0; i < device_table_sz; i++)
if (device_table[i].data == kbd)
device_set_led(&device_table[i], 1, state);
device_set_led(&device_table[i], 1, active_layers);
}
if (!nr_listeners)

Loading…
Cancel
Save