aboutsummaryrefslogtreecommitdiff
path: root/sway/input/input-manager.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-10 17:07:38 +0200
committerGitHub <noreply@github.com>2018-10-10 17:07:38 +0200
commit5d19906556fe27dd9f2ee12a819cc14dd33e3fea (patch)
tree6e61e834d6f8e75c8f5b581556f9d34059e44ae0 /sway/input/input-manager.c
parent0a36d14d7a694a88580da1d9b83837afe608a2eb (diff)
parent073aa4149f25e55c5094f5f54a50351112dcfedd (diff)
Merge pull request #2806 from v-gu/add-libinput-support-for-keyboard
add libinput config for keyboard
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r--sway/input/input-manager.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index 32f0355e..3c7b74d2 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -94,6 +94,28 @@ static bool input_has_seat_configuration(struct sway_input_manager *input) {
return false;
}
+static void input_manager_libinput_config_keyboard(
+ struct sway_input_device *input_device) {
+ struct wlr_input_device *wlr_device = input_device->wlr_device;
+ struct input_config *ic = input_device_get_config(input_device);
+ struct libinput_device *libinput_device;
+
+ if (!ic || !wlr_input_device_is_libinput(wlr_device)) {
+ return;
+ }
+
+ libinput_device = wlr_libinput_get_device_handle(wlr_device);
+ wlr_log(WLR_DEBUG, "input_manager_libinput_config_keyboard(%s)",
+ ic->identifier);
+
+ if (ic->send_events != INT_MIN) {
+ wlr_log(WLR_DEBUG, "libinput_config_keyboard(%s) send_events_set_mode(%d)",
+ ic->identifier, ic->send_events);
+ libinput_device_config_send_events_set_mode(libinput_device,
+ ic->send_events);
+ }
+}
+
static void input_manager_libinput_config_pointer(
struct sway_input_device *input_device) {
struct wlr_input_device *wlr_device = input_device->wlr_device;
@@ -243,6 +265,8 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER ||
input_device->wlr_device->type == WLR_INPUT_DEVICE_TABLET_TOOL) {
input_manager_libinput_config_pointer(input_device);
+ } else if (input_device->wlr_device->type == WLR_INPUT_DEVICE_KEYBOARD) {
+ input_manager_libinput_config_keyboard(input_device);
}
wl_signal_add(&device->events.destroy, &input_device->device_destroy);
@@ -404,6 +428,8 @@ void input_manager_apply_input_config(struct sway_input_manager *input,
if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER ||
input_device->wlr_device->type == WLR_INPUT_DEVICE_TABLET_TOOL) {
input_manager_libinput_config_pointer(input_device);
+ } else if (input_device->wlr_device->type == WLR_INPUT_DEVICE_KEYBOARD) {
+ input_manager_libinput_config_keyboard(input_device);
}
struct sway_seat *seat = NULL;