diff options
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r-- | sway/input/keyboard.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 49241db8..36c5a064 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <wlr/backend/multi.h> | 3 | #include <wlr/backend/multi.h> |
4 | #include <wlr/backend/session.h> | 4 | #include <wlr/backend/session.h> |
5 | #include <wlr/types/wlr_idle.h> | 5 | #include <wlr/types/wlr_idle.h> |
6 | #include <wlr/interfaces/wlr_keyboard.h> | ||
6 | #include "sway/commands.h" | 7 | #include "sway/commands.h" |
7 | #include "sway/desktop/transaction.h" | 8 | #include "sway/desktop/transaction.h" |
8 | #include "sway/input/input-manager.h" | 9 | #include "sway/input/input-manager.h" |
@@ -385,6 +386,23 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { | |||
385 | keyboard->keymap = keymap; | 386 | keyboard->keymap = keymap; |
386 | wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap); | 387 | wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap); |
387 | 388 | ||
389 | xkb_mod_mask_t locked_mods = 0; | ||
390 | if (!input_config || input_config->xkb_numlock != 0) { | ||
391 | xkb_mod_index_t mod_index = xkb_map_mod_get_index(keymap, XKB_MOD_NAME_NUM); | ||
392 | if (mod_index != XKB_MOD_INVALID) { | ||
393 | locked_mods |= (uint32_t)1 << mod_index; | ||
394 | } | ||
395 | } | ||
396 | if (input_config && input_config->xkb_capslock > 0) { | ||
397 | xkb_mod_index_t mod_index = xkb_map_mod_get_index(keymap, XKB_MOD_NAME_CAPS); | ||
398 | if (mod_index != XKB_MOD_INVALID) { | ||
399 | locked_mods |= (uint32_t)1 << mod_index; | ||
400 | } | ||
401 | } | ||
402 | if (locked_mods) { | ||
403 | wlr_keyboard_notify_modifiers(wlr_device->keyboard, 0, 0, locked_mods, 0); | ||
404 | } | ||
405 | |||
388 | if (input_config && input_config->repeat_delay != INT_MIN | 406 | if (input_config && input_config->repeat_delay != INT_MIN |
389 | && input_config->repeat_rate != INT_MIN) { | 407 | && input_config->repeat_rate != INT_MIN) { |
390 | wlr_keyboard_set_repeat_info(wlr_device->keyboard, | 408 | wlr_keyboard_set_repeat_info(wlr_device->keyboard, |