keyboard: add option to enable Num Lock automatically (default=enabled)

Co-authored-by: @Consolatis
This commit is contained in:
John Lindgren 2023-10-08 22:26:26 -04:00 committed by Johan Malm
parent 1f541be481
commit ecad76560e
7 changed files with 46 additions and 0 deletions

View file

@ -211,6 +211,14 @@ new_keyboard(struct seat *seat, struct wlr_input_device *device, bool virtual)
wlr_keyboard_set_keymap(kb, seat->keyboard_group->keyboard.keymap);
/*
* This needs to be before wlr_keyboard_group_add_keyboard().
* For some reason, wlroots takes the modifier state from the
* new keyboard and syncs it to the others in the group, rather
* than the other way around.
*/
keyboard_set_numlock(kb);
if (!virtual) {
wlr_keyboard_group_add_keyboard(seat->keyboard_group, kb);
}