diff options
author | ProgAndy <code@progandy.de> | 2018-07-25 17:09:34 +0200 |
---|---|---|
committer | ProgAndy <code@progandy.de> | 2018-07-25 17:24:45 +0200 |
commit | 76ece5788bffe27b32c85968886f3738d244abf9 (patch) | |
tree | fbe2ecd9c36e7e1d954853f76d813ecdcd1a2e57 | |
parent | Restrict CapsLock and NumLock commands to the configuration file (diff) | |
download | sway-76ece5788bffe27b32c85968886f3738d244abf9.tar.gz sway-76ece5788bffe27b32c85968886f3738d244abf9.tar.zst sway-76ece5788bffe27b32c85968886f3738d244abf9.zip |
Fix LEDs for configured modifier states
-rw-r--r-- | sway/input/keyboard.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 36c5a064..643ff510 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -401,6 +401,14 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { | |||
401 | } | 401 | } |
402 | if (locked_mods) { | 402 | if (locked_mods) { |
403 | wlr_keyboard_notify_modifiers(wlr_device->keyboard, 0, 0, locked_mods, 0); | 403 | wlr_keyboard_notify_modifiers(wlr_device->keyboard, 0, 0, locked_mods, 0); |
404 | uint32_t leds = 0; | ||
405 | for (uint32_t i = 0; i < WLR_LED_COUNT; ++i) { | ||
406 | if (xkb_state_led_index_is_active(wlr_device->keyboard->xkb_state, | ||
407 | wlr_device->keyboard->led_indexes[i])) { | ||
408 | leds |= (1 << i); | ||
409 | } | ||
410 | } | ||
411 | wlr_keyboard_led_update(wlr_device->keyboard, leds); | ||
404 | } | 412 | } |
405 | 413 | ||
406 | if (input_config && input_config->repeat_delay != INT_MIN | 414 | if (input_config && input_config->repeat_delay != INT_MIN |