-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.c
More file actions
25 lines (22 loc) · 676 Bytes
/
input.c
File metadata and controls
25 lines (22 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <includes.h>
#include <input.h>
#include <keyboard.h>
#include <server.h>
void on_new_input(struct wl_listener *listener, void *data) {
struct wlr_input_device *device = data;
switch (device->type) {
case WLR_INPUT_DEVICE_KEYBOARD:
server_new_keyboard(device);
break;
case WLR_INPUT_DEVICE_POINTER:
wlr_cursor_attach_input_device(server->cursor, device);
break;
case WLR_INPUT_DEVICE_TOUCH:
case WLR_INPUT_DEVICE_TABLET_TOOL:
case WLR_INPUT_DEVICE_TABLET_PAD:
case WLR_INPUT_DEVICE_SWITCH:
break;
}
uint32_t caps = WL_SEAT_CAPABILITY_POINTER | WL_SEAT_CAPABILITY_KEYBOARD;
wlr_seat_set_capabilities(server->seat, caps);
}