Skip to content

Introduce wlr_keyboard_group

Simon Ser requested to merge github/fork/RedSoxFan/keyboard-group into master

Created by: RedSoxFan

Closes #1217 (closed) Supersedes/Closes #1421 (closed)

Sway PR: swaywm/sway#4373

A wlr_keyboard_group allows for multiple keyboard devices to be combined into one logical keyboard. Each keyboard device can only be added to one keyboard group. This helps with the situation where one physical keyboard is exposed as multiple keyboard devices. It is up to the compositors on how they group keyboards together, if at all.

Since a wlr_keyboard_group is one logical keyboard, the keys are a set. This means that if a key is pressed on multiple keyboard devices, the key event will only be emitted once, but the internal state will count the number of devices that the key is pressed on. Likewise, the key release will not be emitted until the key is released from all devices. If the compositor wants access to which keys are pressed and released on each keyboard device, the events for those devices can be listened to, as they currently are, in addition to the group keyboard's events.

Also, all keyboard devices in the group must share the same keymap. If the keymap's differ, the keyboard device will not be able to be added to the group. Once in the group, if the keymap or effective layout for one keyboard device changes, it will be synced to all keyboard devices in the group. The repeat info is also synced.

Merge request reports