aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 7fc87ee4..d58ff9e6 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -15,6 +15,7 @@
#include "sway/input/input-manager.h"
#include "sway/input/keyboard.h"
#include "sway/input/seat.h"
+#include "sway/input/switch.h"
#include "sway/ipc-server.h"
#include "sway/layers.h"
#include "sway/output.h"
@@ -482,8 +483,8 @@ static void seat_update_capabilities(struct sway_seat *seat) {
case WLR_INPUT_DEVICE_TABLET_TOOL:
caps |= WL_SEAT_CAPABILITY_POINTER;
break;
- case WLR_INPUT_DEVICE_TABLET_PAD:
case WLR_INPUT_DEVICE_SWITCH:
+ case WLR_INPUT_DEVICE_TABLET_PAD:
break;
}
}
@@ -570,6 +571,15 @@ static void seat_configure_keyboard(struct sway_seat *seat,
}
}
+static void seat_configure_switch(struct sway_seat *seat,
+ struct sway_seat_device *seat_device) {
+ if (!seat_device->switch_device) {
+ sway_switch_create(seat, seat_device);
+ }
+ seat_apply_input_config(seat, seat_device);
+ sway_switch_configure(seat_device->switch_device);
+}
+
static void seat_configure_touch(struct sway_seat *seat,
struct sway_seat_device *sway_device) {
wlr_cursor_attach_input_device(seat->cursor->cursor,
@@ -611,6 +621,9 @@ void seat_configure_device(struct sway_seat *seat,
case WLR_INPUT_DEVICE_KEYBOARD:
seat_configure_keyboard(seat, seat_device);
break;
+ case WLR_INPUT_DEVICE_SWITCH:
+ seat_configure_switch(seat, seat_device);
+ break;
case WLR_INPUT_DEVICE_TOUCH:
seat_configure_touch(seat, seat_device);
break;
@@ -620,9 +633,6 @@ void seat_configure_device(struct sway_seat *seat,
case WLR_INPUT_DEVICE_TABLET_PAD:
sway_log(SWAY_DEBUG, "TODO: configure tablet pad");
break;
- case WLR_INPUT_DEVICE_SWITCH:
- sway_log(SWAY_DEBUG, "TODO: configure switch device");
- break;
}
}