2 * Copyright © 2013 Jonas Ådahl
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation for any purpose is hereby granted without fee, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of the copyright holders not be used in
9 * advertising or publicity pertaining to distribution of the software
10 * without specific, written prior permission. The copyright holders make
11 * no representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29 #include <sys/epoll.h>
34 #include "libinput-private.h"
37 struct libinput_source {
38 libinput_source_dispatch_t dispatch;
44 struct libinput_event {
45 enum libinput_event_type type;
46 struct libinput_device *device;
49 struct libinput_event_device_notify {
50 struct libinput_event base;
53 struct libinput_event_keyboard {
54 struct libinput_event base;
57 enum libinput_keyboard_key_state state;
60 struct libinput_event_pointer {
61 struct libinput_event base;
66 enum libinput_pointer_button_state state;
67 enum libinput_pointer_axis axis;
71 struct libinput_event_touch {
72 struct libinput_event base;
81 libinput_default_log_func(enum libinput_log_priority priority,
83 const char *format, va_list args)
88 case LIBINPUT_LOG_PRIORITY_DEBUG: prefix = "debug"; break;
89 case LIBINPUT_LOG_PRIORITY_INFO: prefix = "info"; break;
90 case LIBINPUT_LOG_PRIORITY_ERROR: prefix = "error"; break;
91 default: prefix="<invalid priority>"; break;
94 fprintf(stderr, "libinput %s: ", prefix);
95 vfprintf(stderr, format, args);
99 enum libinput_log_priority priority;
100 libinput_log_handler handler;
104 static struct log_data log_data = {
105 .priority = LIBINPUT_LOG_PRIORITY_ERROR,
106 .handler = libinput_default_log_func,
111 log_msg(enum libinput_log_priority priority, const char *format, ...)
115 if (log_data.handler && log_data.priority <= priority) {
116 va_start(args, format);
117 log_data.handler(priority, log_data.user_data, format, args);
123 libinput_log_set_priority(enum libinput_log_priority priority)
125 log_data.priority = priority;
128 LIBINPUT_EXPORT enum libinput_log_priority
129 libinput_log_get_priority(void)
131 return log_data.priority;
135 libinput_log_set_handler(libinput_log_handler log_handler,
138 log_data.handler = log_handler;
139 log_data.user_data = user_data;
143 libinput_post_event(struct libinput *libinput,
144 struct libinput_event *event);
146 LIBINPUT_EXPORT enum libinput_event_type
147 libinput_event_get_type(struct libinput_event *event)
152 LIBINPUT_EXPORT struct libinput *
153 libinput_event_get_context(struct libinput_event *event)
155 return event->device->seat->libinput;
158 LIBINPUT_EXPORT struct libinput_device *
159 libinput_event_get_device(struct libinput_event *event)
161 return event->device;
164 LIBINPUT_EXPORT struct libinput_event_pointer *
165 libinput_event_get_pointer_event(struct libinput_event *event)
167 switch (event->type) {
168 case LIBINPUT_EVENT_NONE:
169 abort(); /* not used as actual event type */
170 case LIBINPUT_EVENT_DEVICE_ADDED:
171 case LIBINPUT_EVENT_DEVICE_REMOVED:
172 case LIBINPUT_EVENT_KEYBOARD_KEY:
174 case LIBINPUT_EVENT_POINTER_MOTION:
175 case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
176 case LIBINPUT_EVENT_POINTER_BUTTON:
177 case LIBINPUT_EVENT_POINTER_AXIS:
178 return (struct libinput_event_pointer *) event;
179 case LIBINPUT_EVENT_TOUCH_DOWN:
180 case LIBINPUT_EVENT_TOUCH_UP:
181 case LIBINPUT_EVENT_TOUCH_MOTION:
182 case LIBINPUT_EVENT_TOUCH_CANCEL:
183 case LIBINPUT_EVENT_TOUCH_FRAME:
190 LIBINPUT_EXPORT struct libinput_event_keyboard *
191 libinput_event_get_keyboard_event(struct libinput_event *event)
193 switch (event->type) {
194 case LIBINPUT_EVENT_NONE:
195 abort(); /* not used as actual event type */
196 case LIBINPUT_EVENT_DEVICE_ADDED:
197 case LIBINPUT_EVENT_DEVICE_REMOVED:
199 case LIBINPUT_EVENT_KEYBOARD_KEY:
200 return (struct libinput_event_keyboard *) event;
201 case LIBINPUT_EVENT_POINTER_MOTION:
202 case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
203 case LIBINPUT_EVENT_POINTER_BUTTON:
204 case LIBINPUT_EVENT_POINTER_AXIS:
205 case LIBINPUT_EVENT_TOUCH_DOWN:
206 case LIBINPUT_EVENT_TOUCH_UP:
207 case LIBINPUT_EVENT_TOUCH_MOTION:
208 case LIBINPUT_EVENT_TOUCH_CANCEL:
209 case LIBINPUT_EVENT_TOUCH_FRAME:
216 LIBINPUT_EXPORT struct libinput_event_touch *
217 libinput_event_get_touch_event(struct libinput_event *event)
219 switch (event->type) {
220 case LIBINPUT_EVENT_NONE:
221 abort(); /* not used as actual event type */
222 case LIBINPUT_EVENT_DEVICE_ADDED:
223 case LIBINPUT_EVENT_DEVICE_REMOVED:
224 case LIBINPUT_EVENT_KEYBOARD_KEY:
225 case LIBINPUT_EVENT_POINTER_MOTION:
226 case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
227 case LIBINPUT_EVENT_POINTER_BUTTON:
228 case LIBINPUT_EVENT_POINTER_AXIS:
230 case LIBINPUT_EVENT_TOUCH_DOWN:
231 case LIBINPUT_EVENT_TOUCH_UP:
232 case LIBINPUT_EVENT_TOUCH_MOTION:
233 case LIBINPUT_EVENT_TOUCH_CANCEL:
234 case LIBINPUT_EVENT_TOUCH_FRAME:
235 return (struct libinput_event_touch *) event;
241 LIBINPUT_EXPORT struct libinput_event_device_notify *
242 libinput_event_get_device_notify_event(struct libinput_event *event)
244 switch (event->type) {
245 case LIBINPUT_EVENT_NONE:
246 abort(); /* not used as actual event type */
247 case LIBINPUT_EVENT_DEVICE_ADDED:
248 case LIBINPUT_EVENT_DEVICE_REMOVED:
249 return (struct libinput_event_device_notify *) event;
250 case LIBINPUT_EVENT_KEYBOARD_KEY:
251 case LIBINPUT_EVENT_POINTER_MOTION:
252 case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
253 case LIBINPUT_EVENT_POINTER_BUTTON:
254 case LIBINPUT_EVENT_POINTER_AXIS:
255 case LIBINPUT_EVENT_TOUCH_DOWN:
256 case LIBINPUT_EVENT_TOUCH_UP:
257 case LIBINPUT_EVENT_TOUCH_MOTION:
258 case LIBINPUT_EVENT_TOUCH_CANCEL:
259 case LIBINPUT_EVENT_TOUCH_FRAME:
266 LIBINPUT_EXPORT uint32_t
267 libinput_event_keyboard_get_time(struct libinput_event_keyboard *event)
272 LIBINPUT_EXPORT uint32_t
273 libinput_event_keyboard_get_key(struct libinput_event_keyboard *event)
278 LIBINPUT_EXPORT enum libinput_keyboard_key_state
279 libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event)
284 LIBINPUT_EXPORT uint32_t
285 libinput_event_pointer_get_time(struct libinput_event_pointer *event)
290 LIBINPUT_EXPORT li_fixed_t
291 libinput_event_pointer_get_dx(struct libinput_event_pointer *event)
296 LIBINPUT_EXPORT li_fixed_t
297 libinput_event_pointer_get_dy(struct libinput_event_pointer *event)
302 LIBINPUT_EXPORT li_fixed_t
303 libinput_event_pointer_get_absolute_x(struct libinput_event_pointer *event)
308 LIBINPUT_EXPORT li_fixed_t
309 libinput_event_pointer_get_absolute_y(struct libinput_event_pointer *event)
314 LIBINPUT_EXPORT li_fixed_t
315 libinput_event_pointer_get_absolute_x_transformed(
316 struct libinput_event_pointer *event,
319 struct evdev_device *device =
320 (struct evdev_device *) event->base.device;
322 return evdev_device_transform_x(device, event->x, width);
325 LIBINPUT_EXPORT li_fixed_t
326 libinput_event_pointer_get_absolute_y_transformed(
327 struct libinput_event_pointer *event,
330 struct evdev_device *device =
331 (struct evdev_device *) event->base.device;
333 return evdev_device_transform_y(device, event->y, height);
336 LIBINPUT_EXPORT uint32_t
337 libinput_event_pointer_get_button(struct libinput_event_pointer *event)
339 return event->button;
342 LIBINPUT_EXPORT enum libinput_pointer_button_state
343 libinput_event_pointer_get_button_state(struct libinput_event_pointer *event)
348 LIBINPUT_EXPORT enum libinput_pointer_axis
349 libinput_event_pointer_get_axis(struct libinput_event_pointer *event)
354 LIBINPUT_EXPORT li_fixed_t
355 libinput_event_pointer_get_axis_value(struct libinput_event_pointer *event)
360 LIBINPUT_EXPORT uint32_t
361 libinput_event_touch_get_time(struct libinput_event_touch *event)
366 LIBINPUT_EXPORT int32_t
367 libinput_event_touch_get_slot(struct libinput_event_touch *event)
372 LIBINPUT_EXPORT int32_t
373 libinput_event_touch_get_seat_slot(struct libinput_event_touch *event)
375 return event->seat_slot;
378 LIBINPUT_EXPORT li_fixed_t
379 libinput_event_touch_get_x(struct libinput_event_touch *event)
384 LIBINPUT_EXPORT li_fixed_t
385 libinput_event_touch_get_x_transformed(struct libinput_event_touch *event,
388 struct evdev_device *device =
389 (struct evdev_device *) event->base.device;
391 return evdev_device_transform_x(device, event->x, width);
394 LIBINPUT_EXPORT li_fixed_t
395 libinput_event_touch_get_y_transformed(struct libinput_event_touch *event,
398 struct evdev_device *device =
399 (struct evdev_device *) event->base.device;
401 return evdev_device_transform_y(device, event->y, height);
404 LIBINPUT_EXPORT li_fixed_t
405 libinput_event_touch_get_y(struct libinput_event_touch *event)
410 struct libinput_source *
411 libinput_add_fd(struct libinput *libinput,
413 libinput_source_dispatch_t dispatch,
416 struct libinput_source *source;
417 struct epoll_event ep;
419 source = malloc(sizeof *source);
423 source->dispatch = dispatch;
424 source->user_data = user_data;
427 memset(&ep, 0, sizeof ep);
429 ep.data.ptr = source;
431 if (epoll_ctl(libinput->epoll_fd, EPOLL_CTL_ADD, fd, &ep) < 0) {
441 libinput_remove_source(struct libinput *libinput,
442 struct libinput_source *source)
444 epoll_ctl(libinput->epoll_fd, EPOLL_CTL_DEL, source->fd, NULL);
447 list_insert(&libinput->source_destroy_list, &source->link);
451 libinput_init(struct libinput *libinput,
452 const struct libinput_interface *interface,
453 const struct libinput_interface_backend *interface_backend,
456 libinput->epoll_fd = epoll_create1(EPOLL_CLOEXEC);;
457 if (libinput->epoll_fd < 0)
460 libinput->events_len = 4;
461 libinput->events = zalloc(libinput->events_len * sizeof(*libinput->events));
462 if (!libinput->events) {
463 close(libinput->epoll_fd);
467 libinput->interface = interface;
468 libinput->interface_backend = interface_backend;
469 libinput->user_data = user_data;
470 list_init(&libinput->source_destroy_list);
471 list_init(&libinput->seat_list);
477 libinput_device_destroy(struct libinput_device *device);
480 libinput_seat_destroy(struct libinput_seat *seat);
483 libinput_drop_destroyed_sources(struct libinput *libinput)
485 struct libinput_source *source, *next;
487 list_for_each_safe(source, next, &libinput->source_destroy_list, link)
489 list_init(&libinput->source_destroy_list);
493 libinput_destroy(struct libinput *libinput)
495 struct libinput_event *event;
496 struct libinput_device *device, *next_device;
497 struct libinput_seat *seat, *next_seat;
499 if (libinput == NULL)
502 libinput_suspend(libinput);
504 libinput->interface_backend->destroy(libinput);
506 while ((event = libinput_get_event(libinput)))
507 libinput_event_destroy(event);
509 libinput_drop_destroyed_sources(libinput);
511 free(libinput->events);
513 list_for_each_safe(seat, next_seat, &libinput->seat_list, link) {
514 list_for_each_safe(device, next_device,
517 libinput_device_destroy(device);
519 libinput_seat_destroy(seat);
522 close(libinput->epoll_fd);
527 libinput_event_destroy(struct libinput_event *event)
533 libinput_device_unref(event->device);
539 open_restricted(struct libinput *libinput,
540 const char *path, int flags)
542 return libinput->interface->open_restricted(path,
544 libinput->user_data);
548 close_restricted(struct libinput *libinput, int fd)
550 return libinput->interface->close_restricted(fd, libinput->user_data);
554 libinput_seat_init(struct libinput_seat *seat,
555 struct libinput *libinput,
556 const char *physical_name,
557 const char *logical_name,
558 libinput_seat_destroy_func destroy)
561 seat->libinput = libinput;
562 seat->physical_name = strdup(physical_name);
563 seat->logical_name = strdup(logical_name);
564 seat->destroy = destroy;
565 list_init(&seat->devices_list);
566 list_insert(&libinput->seat_list, &seat->link);
570 libinput_seat_ref(struct libinput_seat *seat)
576 libinput_seat_destroy(struct libinput_seat *seat)
578 list_remove(&seat->link);
579 free(seat->logical_name);
580 free(seat->physical_name);
585 libinput_seat_unref(struct libinput_seat *seat)
587 assert(seat->refcount > 0);
589 if (seat->refcount == 0)
590 libinput_seat_destroy(seat);
594 libinput_seat_set_user_data(struct libinput_seat *seat, void *user_data)
596 seat->user_data = user_data;
599 LIBINPUT_EXPORT void *
600 libinput_seat_get_user_data(struct libinput_seat *seat)
602 return seat->user_data;
605 LIBINPUT_EXPORT const char *
606 libinput_seat_get_physical_name(struct libinput_seat *seat)
608 return seat->physical_name;
611 LIBINPUT_EXPORT const char *
612 libinput_seat_get_logical_name(struct libinput_seat *seat)
614 return seat->logical_name;
618 libinput_device_init(struct libinput_device *device,
619 struct libinput_seat *seat)
622 device->refcount = 1;
626 libinput_device_ref(struct libinput_device *device)
632 libinput_device_destroy(struct libinput_device *device)
634 evdev_device_destroy((struct evdev_device *) device);
638 libinput_device_unref(struct libinput_device *device)
640 assert(device->refcount > 0);
642 if (device->refcount == 0)
643 libinput_device_destroy(device);
647 libinput_get_fd(struct libinput *libinput)
649 return libinput->epoll_fd;
653 libinput_dispatch(struct libinput *libinput)
655 struct libinput_source *source;
656 struct epoll_event ep[32];
659 count = epoll_wait(libinput->epoll_fd, ep, ARRAY_LENGTH(ep), 0);
663 for (i = 0; i < count; ++i) {
664 source = ep[i].data.ptr;
665 if (source->fd == -1)
668 source->dispatch(source->user_data);
671 libinput_drop_destroyed_sources(libinput);
677 init_event_base(struct libinput_event *event,
678 struct libinput_device *device,
679 enum libinput_event_type type)
682 event->device = device;
686 post_base_event(struct libinput_device *device,
687 enum libinput_event_type type,
688 struct libinput_event *event)
690 struct libinput *libinput = device->seat->libinput;
691 init_event_base(event, device, type);
692 libinput_post_event(libinput, event);
696 post_device_event(struct libinput_device *device,
697 enum libinput_event_type type,
698 struct libinput_event *event)
700 init_event_base(event, device, type);
701 libinput_post_event(device->seat->libinput, event);
705 notify_added_device(struct libinput_device *device)
707 struct libinput_event_device_notify *added_device_event;
709 added_device_event = zalloc(sizeof *added_device_event);
710 if (!added_device_event)
713 post_base_event(device,
714 LIBINPUT_EVENT_DEVICE_ADDED,
715 &added_device_event->base);
719 notify_removed_device(struct libinput_device *device)
721 struct libinput_event_device_notify *removed_device_event;
723 removed_device_event = zalloc(sizeof *removed_device_event);
724 if (!removed_device_event)
727 post_base_event(device,
728 LIBINPUT_EVENT_DEVICE_REMOVED,
729 &removed_device_event->base);
733 keyboard_notify_key(struct libinput_device *device,
736 enum libinput_keyboard_key_state state)
738 struct libinput_event_keyboard *key_event;
740 key_event = zalloc(sizeof *key_event);
744 *key_event = (struct libinput_event_keyboard) {
750 post_device_event(device,
751 LIBINPUT_EVENT_KEYBOARD_KEY,
756 pointer_notify_motion(struct libinput_device *device,
761 struct libinput_event_pointer *motion_event;
763 motion_event = zalloc(sizeof *motion_event);
767 *motion_event = (struct libinput_event_pointer) {
773 post_device_event(device,
774 LIBINPUT_EVENT_POINTER_MOTION,
775 &motion_event->base);
779 pointer_notify_motion_absolute(struct libinput_device *device,
784 struct libinput_event_pointer *motion_absolute_event;
786 motion_absolute_event = zalloc(sizeof *motion_absolute_event);
787 if (!motion_absolute_event)
790 *motion_absolute_event = (struct libinput_event_pointer) {
796 post_device_event(device,
797 LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE,
798 &motion_absolute_event->base);
802 pointer_notify_button(struct libinput_device *device,
805 enum libinput_pointer_button_state state)
807 struct libinput_event_pointer *button_event;
809 button_event = zalloc(sizeof *button_event);
813 *button_event = (struct libinput_event_pointer) {
819 post_device_event(device,
820 LIBINPUT_EVENT_POINTER_BUTTON,
821 &button_event->base);
825 pointer_notify_axis(struct libinput_device *device,
827 enum libinput_pointer_axis axis,
830 struct libinput_event_pointer *axis_event;
832 axis_event = zalloc(sizeof *axis_event);
836 *axis_event = (struct libinput_event_pointer) {
842 post_device_event(device,
843 LIBINPUT_EVENT_POINTER_AXIS,
848 touch_notify_touch_down(struct libinput_device *device,
855 struct libinput_event_touch *touch_event;
857 touch_event = zalloc(sizeof *touch_event);
861 *touch_event = (struct libinput_event_touch) {
864 .seat_slot = seat_slot,
869 post_device_event(device,
870 LIBINPUT_EVENT_TOUCH_DOWN,
875 touch_notify_touch_motion(struct libinput_device *device,
882 struct libinput_event_touch *touch_event;
884 touch_event = zalloc(sizeof *touch_event);
888 *touch_event = (struct libinput_event_touch) {
891 .seat_slot = seat_slot,
896 post_device_event(device,
897 LIBINPUT_EVENT_TOUCH_MOTION,
902 touch_notify_touch_up(struct libinput_device *device,
907 struct libinput_event_touch *touch_event;
909 touch_event = zalloc(sizeof *touch_event);
913 *touch_event = (struct libinput_event_touch) {
916 .seat_slot = seat_slot,
919 post_device_event(device,
920 LIBINPUT_EVENT_TOUCH_UP,
925 touch_notify_frame(struct libinput_device *device,
928 struct libinput_event_touch *touch_event;
930 touch_event = zalloc(sizeof *touch_event);
934 *touch_event = (struct libinput_event_touch) {
938 post_device_event(device,
939 LIBINPUT_EVENT_TOUCH_FRAME,
945 libinput_post_event(struct libinput *libinput,
946 struct libinput_event *event)
948 struct libinput_event **events = libinput->events;
949 size_t events_len = libinput->events_len;
950 size_t events_count = libinput->events_count;
955 if (events_count > events_len) {
957 events = realloc(events, events_len * sizeof *events);
959 fprintf(stderr, "Failed to reallocate event ring "
964 if (libinput->events_count > 0 && libinput->events_in == 0) {
965 libinput->events_in = libinput->events_len;
966 } else if (libinput->events_count > 0 &&
967 libinput->events_out >= libinput->events_in) {
968 move_len = libinput->events_len - libinput->events_out;
969 new_out = events_len - move_len;
970 memmove(events + new_out,
971 events + libinput->events_out,
972 move_len * sizeof *events);
973 libinput->events_out = new_out;
976 libinput->events = events;
977 libinput->events_len = events_len;
981 libinput_device_ref(event->device);
983 libinput->events_count = events_count;
984 events[libinput->events_in] = event;
985 libinput->events_in = (libinput->events_in + 1) % libinput->events_len;
988 LIBINPUT_EXPORT struct libinput_event *
989 libinput_get_event(struct libinput *libinput)
991 struct libinput_event *event;
993 if (libinput->events_count == 0)
996 event = libinput->events[libinput->events_out];
997 libinput->events_out =
998 (libinput->events_out + 1) % libinput->events_len;
999 libinput->events_count--;
1004 LIBINPUT_EXPORT enum libinput_event_type
1005 libinput_next_event_type(struct libinput *libinput)
1007 struct libinput_event *event;
1009 if (libinput->events_count == 0)
1010 return LIBINPUT_EVENT_NONE;
1012 event = libinput->events[libinput->events_out];
1016 LIBINPUT_EXPORT void *
1017 libinput_get_user_data(struct libinput *libinput)
1019 return libinput->user_data;
1023 libinput_resume(struct libinput *libinput)
1025 return libinput->interface_backend->resume(libinput);
1028 LIBINPUT_EXPORT void
1029 libinput_suspend(struct libinput *libinput)
1031 libinput->interface_backend->suspend(libinput);
1034 LIBINPUT_EXPORT void
1035 libinput_device_set_user_data(struct libinput_device *device, void *user_data)
1037 device->user_data = user_data;
1040 LIBINPUT_EXPORT void *
1041 libinput_device_get_user_data(struct libinput_device *device)
1043 return device->user_data;
1046 LIBINPUT_EXPORT const char *
1047 libinput_device_get_sysname(struct libinput_device *device)
1049 return evdev_device_get_sysname((struct evdev_device *) device);
1052 LIBINPUT_EXPORT const char *
1053 libinput_device_get_output_name(struct libinput_device *device)
1055 return evdev_device_get_output((struct evdev_device *) device);
1058 LIBINPUT_EXPORT struct libinput_seat *
1059 libinput_device_get_seat(struct libinput_device *device)
1061 return device->seat;
1064 LIBINPUT_EXPORT void
1065 libinput_device_led_update(struct libinput_device *device,
1066 enum libinput_led leds)
1068 evdev_device_led_update((struct evdev_device *) device, leds);
1072 libinput_device_get_keys(struct libinput_device *device,
1073 char *keys, size_t size)
1075 return evdev_device_get_keys((struct evdev_device *) device,
1080 LIBINPUT_EXPORT void
1081 libinput_device_calibrate(struct libinput_device *device,
1082 float calibration[6])
1084 evdev_device_calibrate((struct evdev_device *) device, calibration);
1088 libinput_device_has_capability(struct libinput_device *device,
1089 enum libinput_device_capability capability)
1091 return evdev_device_has_capability((struct evdev_device *) device,