aboutsummaryrefslogtreecommitdiff
path: root/sway/input/keyboard.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-12-12 08:29:37 -0500
committerTony Crisci <tony@dubstepdish.com>2017-12-12 08:29:37 -0500
commit163edc5a900fda58e006ed30e14ae10cc4aa13b3 (patch)
treea43e355091da4545bf9f16c63accb7d853170195 /sway/input/keyboard.c
parent462a451328a1d6f0b17d34b431d6bf3dec87c1ba (diff)
sway input device
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 31d254df..6a792c65 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -6,7 +6,7 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
struct sway_keyboard *keyboard =
wl_container_of(listener, keyboard, keyboard_key);
struct wlr_event_keyboard_key *event = data;
- wlr_seat_set_keyboard(keyboard->seat->seat, keyboard->device);
+ wlr_seat_set_keyboard(keyboard->seat->seat, keyboard->device->wlr_device);
wlr_seat_keyboard_notify_key(keyboard->seat->seat, event->time_msec,
event->keycode, event->state);
}
@@ -15,12 +15,12 @@ static void handle_keyboard_modifiers(struct wl_listener *listener,
void *data) {
struct sway_keyboard *keyboard =
wl_container_of(listener, keyboard, keyboard_modifiers);
- wlr_seat_set_keyboard(keyboard->seat->seat, keyboard->device);
+ wlr_seat_set_keyboard(keyboard->seat->seat, keyboard->device->wlr_device);
wlr_seat_keyboard_notify_modifiers(keyboard->seat->seat);
}
struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat,
- struct wlr_input_device *device) {
+ struct sway_input_device *device) {
struct sway_keyboard *keyboard =
calloc(1, sizeof(struct sway_keyboard));
if (!sway_assert(keyboard, "could not allocate sway keyboard")) {
@@ -43,18 +43,18 @@ struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat,
return NULL;
}
- wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context,
- &rules, XKB_KEYMAP_COMPILE_NO_FLAGS));
+ wlr_keyboard_set_keymap(device->wlr_device->keyboard,
+ xkb_map_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS));
xkb_context_unref(context);
- wl_signal_add(&device->keyboard->events.key, &keyboard->keyboard_key);
+ wl_signal_add(&device->wlr_device->keyboard->events.key,
+ &keyboard->keyboard_key);
keyboard->keyboard_key.notify = handle_keyboard_key;
- wl_signal_add(&device->keyboard->events.modifiers, &keyboard->keyboard_modifiers);
+ wl_signal_add(&device->wlr_device->keyboard->events.modifiers,
+ &keyboard->keyboard_modifiers);
keyboard->keyboard_modifiers.notify = handle_keyboard_modifiers;
- wl_list_insert(&seat->keyboards, &keyboard->link);
-
return keyboard;
}