aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-11-03 14:20:05 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-11-21 10:42:10 -0500
commit5d882cb5fc2d9d9fd68439021e48a90aa2e50e79 (patch)
treec519449aebb2fa15406407eee5af3cd4164e1b62 /sway/input/seat.c
parentinput_cmd_xkb_file: allow shell path expansion (diff)
downloadsway-5d882cb5fc2d9d9fd68439021e48a90aa2e50e79.tar.gz
sway-5d882cb5fc2d9d9fd68439021e48a90aa2e50e79.tar.zst
sway-5d882cb5fc2d9d9fd68439021e48a90aa2e50e79.zip
Add support for wlr_keyboard_group
A wlr_keyboard_group allows for multiple keyboard devices to be combined into one logical keyboard. This is useful for keyboards that are split into multiple input devices despite appearing as one physical keyboard in the user's mind. This adds support for wlr_keyboard_groups to sway. There are two keyboard groupings currently supported, which can be set on a per-seat basis. The first keyboard grouping is none, which disables all grouping and provides no functional change. The second is keymap, which groups the keyboard devices in the seat by their keymap. With this grouping, the effective layout and repeat info is also synced across keyboard devices in the seat. Device specific bindings will still be executed as normal, but everything else related to key and modifier events will be handled by the keyboard group's keyboard.
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index f486d5e7..fb3e68ee 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -102,6 +102,14 @@ static struct sway_keyboard *sway_keyboard_for_wlr_keyboard(
102 return seat_device->keyboard; 102 return seat_device->keyboard;
103 } 103 }
104 } 104 }
105 struct sway_keyboard_group *group;
106 wl_list_for_each(group, &seat->keyboard_groups, link) {
107 struct sway_input_device *input_device =
108 group->seat_device->input_device;
109 if (input_device->wlr_device->keyboard == wlr_keyboard) {
110 return group->seat_device->keyboard;
111 }
112 }
105 return NULL; 113 return NULL;
106} 114}
107 115
@@ -519,6 +527,7 @@ struct sway_seat *seat_create(const char *seat_name) {
519 handle_request_set_primary_selection; 527 handle_request_set_primary_selection;
520 528
521 wl_list_init(&seat->devices); 529 wl_list_init(&seat->devices);
530 wl_list_init(&seat->keyboard_groups);
522 531
523 wl_list_insert(&server.input->seats, &seat->link); 532 wl_list_insert(&server.input->seats, &seat->link);
524 533