2 #include "e_input_private.h"
4 static void _device_modifiers_update(E_Input_Evdev *edev);
7 _device_calibration_set(E_Input_Evdev *edev)
13 output = e_comp_screen_primary_output_get(e_comp->e_comp_screen);
14 e_output_size_get(output, &w, &h);
18 edev->mouse.minx = edev->mouse.miny = 0;
22 if (libinput_device_has_capability(edev->device, LIBINPUT_DEVICE_CAP_POINTER))
24 edev->seat->ptr.dx = (double)(w / 2);
25 edev->seat->ptr.dy = (double)(h / 2);
26 edev->seat->ptr.ix = (int)edev->seat->ptr.dx;
27 edev->seat->ptr.iy = (int)edev->seat->ptr.dy;
28 edev->mouse.dx = edev->seat->ptr.dx;
29 edev->mouse.dy = edev->seat->ptr.dy;
31 if (output->config.rotation == 90 || output->config.rotation == 270)
33 temp = edev->mouse.minx;
34 edev->mouse.minx = edev->mouse.miny;
35 edev->mouse.miny = temp;
37 temp = edev->mouse.maxw;
38 edev->mouse.maxw = edev->mouse.maxh;
39 edev->mouse.maxh = temp;
45 #ifdef _F_E_INPUT_ENABLE_DEVICE_CALIBRATION_
51 if ((!libinput_device_config_calibration_has_matrix(edev->device)) ||
52 (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
55 sysname = libinput_device_get_sysname(edev->device);
57 devices = eeze_udev_find_by_subsystem_sysname("input", sysname);
58 if (eina_list_count(devices) < 1) return;
60 #ifdef _F_E_INPUT_USE_WL_CALIBRATION_
62 enum libinput_config_status status;
64 EINA_LIST_FREE(devices, device)
66 vals = eeze_udev_syspath_get_property(device, "WL_CALIBRATION");
68 (sscanf(vals, "%f %f %f %f %f %f",
69 &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
76 libinput_device_config_calibration_set_matrix(edev->device, cal);
78 if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
79 ERR("Failed to apply calibration");
82 eina_stringshare_del(device);
85 #endif//_F_E_INPUT_USE_WL_CALIBRATION_
86 #endif//_F_E_INPUT_ENABLE_DEVICE_CALIBRATION_
91 _device_configure(E_Input_Evdev *edev)
93 if (libinput_device_config_tap_get_finger_count(edev->device) > 0)
95 Eina_Bool tap = EINA_FALSE;
97 tap = libinput_device_config_tap_get_default_enabled(edev->device);
98 libinput_device_config_tap_set_enabled(edev->device, tap);
101 _device_calibration_set(edev);
105 _device_keyboard_setup(E_Input_Evdev *edev)
107 E_Input_Backend *input;
108 xkb_mod_index_t xkb_idx;
110 if ((!edev) || (!edev->seat)) return;
111 if (!(input = edev->seat->input)) return;
112 if (!input->dev->xkb_ctx) return;
114 /* create keymap from xkb context */
115 edev->xkb.keymap = _e_input_device_cached_keymap_get(input->dev->xkb_ctx, NULL, 0);
116 if (!edev->xkb.keymap)
118 ERR("Failed to create keymap: %m");
122 /* create xkb state */
123 if (!(edev->xkb.state = xkb_state_new(edev->xkb.keymap)))
125 ERR("Failed to create xkb state: %m");
129 xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_CTRL);
130 if (xkb_idx != XKB_MOD_INVALID)
131 edev->xkb.ctrl_mask = 1 << xkb_idx;
133 edev->xkb.ctrl_mask = 0;
135 xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_ALT);
136 if (xkb_idx != XKB_MOD_INVALID)
137 edev->xkb.alt_mask = 1 << xkb_idx;
139 edev->xkb.alt_mask = 0;
141 xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_SHIFT);
142 if (xkb_idx != XKB_MOD_INVALID)
143 edev->xkb.shift_mask = 1 << xkb_idx;
145 edev->xkb.shift_mask = 0;
147 xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_LOGO);
148 if (xkb_idx != XKB_MOD_INVALID)
149 edev->xkb.win_mask = 1 << xkb_idx;
151 edev->xkb.win_mask = 0;
153 xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_LED_NAME_SCROLL);
154 if (xkb_idx != XKB_MOD_INVALID)
155 edev->xkb.scroll_mask = 1 << xkb_idx;
157 edev->xkb.scroll_mask = 0;
159 xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_LED_NAME_NUM);
160 if (xkb_idx != XKB_MOD_INVALID)
161 edev->xkb.num_mask = 1 << xkb_idx;
163 edev->xkb.num_mask = 0;
165 xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_CAPS);
166 if (xkb_idx != XKB_MOD_INVALID)
167 edev->xkb.caps_mask = 1 << xkb_idx;
169 edev->xkb.caps_mask = 0;
171 xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, "ISO_Level3_Shift");
172 if (xkb_idx != XKB_MOD_INVALID)
173 edev->xkb.altgr_mask = 1 << xkb_idx;
175 edev->xkb.altgr_mask = 0;
179 _device_keysym_translate(xkb_keysym_t keysym, unsigned int modifiers, char *buffer, int bytes)
181 unsigned long hbytes = 0;
184 if (!keysym) return 0;
185 hbytes = (keysym >> 8);
190 (((keysym >= XKB_KEY_BackSpace) && (keysym <= XKB_KEY_Clear)) ||
191 (keysym == XKB_KEY_Return) || (keysym == XKB_KEY_Escape) ||
192 (keysym == XKB_KEY_KP_Space) || (keysym == XKB_KEY_KP_Tab) ||
193 (keysym == XKB_KEY_KP_Enter) ||
194 ((keysym >= XKB_KEY_KP_Multiply) && (keysym <= XKB_KEY_KP_9)) ||
195 (keysym == XKB_KEY_KP_Equal) || (keysym == XKB_KEY_Delete))))))
198 if (keysym == XKB_KEY_KP_Space)
199 c = (XKB_KEY_space & 0x7F);
200 else if (hbytes == 0xFF)
205 if (modifiers & ECORE_EVENT_MODIFIER_CTRL)
207 if (((c >= '@') && (c < '\177')) || c == ' ')
211 else if ((c >= '3') && (c <= '7'))
223 _device_modifiers_update_device(E_Input_Evdev *edev, E_Input_Evdev *from)
227 edev->xkb.depressed =
228 xkb_state_serialize_mods(from->xkb.state, XKB_STATE_DEPRESSED);
230 xkb_state_serialize_mods(from->xkb.state, XKB_STATE_LATCHED);
232 xkb_state_serialize_mods(from->xkb.state, XKB_STATE_LOCKED);
234 xkb_state_serialize_mods(from->xkb.state, XKB_STATE_EFFECTIVE);
236 mask = (edev->xkb.depressed | edev->xkb.latched);
238 if (mask & from->xkb.ctrl_mask)
239 edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_CTRL;
240 if (mask & from->xkb.alt_mask)
241 edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_ALT;
242 if (mask & from->xkb.shift_mask)
243 edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
244 if (mask & from->xkb.win_mask)
245 edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_WIN;
246 if (mask & from->xkb.scroll_mask)
247 edev->xkb.modifiers |= ECORE_EVENT_LOCK_SCROLL;
248 if (mask & from->xkb.num_mask)
249 edev->xkb.modifiers |= ECORE_EVENT_LOCK_NUM;
250 if (mask & from->xkb.caps_mask)
251 edev->xkb.modifiers |= ECORE_EVENT_LOCK_CAPS;
252 if (mask & from->xkb.altgr_mask)
253 edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
257 _device_modifiers_update(E_Input_Evdev *edev)
262 edev->xkb.modifiers = 0;
264 if (edev->caps & E_INPUT_SEAT_KEYBOARD)
265 _device_modifiers_update_device(edev, edev);
268 EINA_LIST_FOREACH(edev->seat->devices, l, ed)
270 if (!(ed->caps & E_INPUT_SEAT_KEYBOARD)) continue;
271 _device_modifiers_update_device(edev, ed);
278 _device_remapped_key_get(E_Input_Evdev *edev, int code)
282 EINA_SAFETY_ON_NULL_RETURN_VAL(edev, code);
283 if (!edev->key_remap_enabled) return code;
284 EINA_SAFETY_ON_NULL_RETURN_VAL(edev->key_remap_hash, code);
286 ret = eina_hash_find(edev->key_remap_hash, &code);
288 if (ret) code = (int)(intptr_t)ret;
294 e_input_evdev_get_ecore_device(const char *path, Ecore_Device_Class clas)
296 const Eina_List *dev_list = NULL;
298 Ecore_Device *dev = NULL;
299 const char *identifier;
301 if (!path) return NULL;
303 dev_list = ecore_device_list();
304 if (!dev_list) return NULL;
305 EINA_LIST_FOREACH(dev_list, l, dev)
308 identifier = ecore_device_identifier_get(dev);
309 if (!identifier) continue;
310 if ((ecore_device_class_get(dev) == clas) && !(strcmp(identifier, path)))
317 _e_input_event_mouse_move_cb_free(void *data EINA_UNUSED, void *event)
319 Ecore_Event_Mouse_Move *ev = event;
321 if (ev->dev) ecore_device_unref(ev->dev);
327 _e_input_event_mouse_wheel_cb_free(void *data EINA_UNUSED, void *event)
329 Ecore_Event_Mouse_Wheel *ev = event;
331 if (ev->dev) ecore_device_unref(ev->dev);
337 _e_input_event_mouse_button_cb_free(void *data EINA_UNUSED, void *event)
339 Ecore_Event_Mouse_Button *ev = event;
341 if (ev->dev) ecore_device_unref(ev->dev);
347 _e_input_event_key_cb_free(void *data EINA_UNUSED, void *event)
349 Ecore_Event_Key *ev = event;
351 if (ev->dev) ecore_device_unref(ev->dev);
352 if (ev->data) E_FREE(ev->data);
358 _device_handle_key(struct libinput_device *device, struct libinput_event_keyboard *event)
361 E_Input_Backend *input;
363 uint32_t code, nsyms;
364 const xkb_keysym_t *syms;
365 enum libinput_key_state state;
367 xkb_keysym_t sym = XKB_KEY_NoSymbol;
368 char key[256], keyname[256], compose_buffer[256];
370 char *tmp = NULL, *compose = NULL;
371 E_Keyrouter_Event_Data *key_data;
372 Ecore_Device *ecore_dev = NULL, *data;
375 if (!(edev = libinput_device_get_user_data(device)))
380 if (!(input = edev->seat->input))
385 if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
386 else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
388 EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
390 if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_KEYBOARD)
399 edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_KEYBOARD);
400 ecore_dev = edev->ecore_dev;
405 ERR("Failed to get source ecore device from event !\n");
409 timestamp = libinput_event_keyboard_get_time(event);
410 code = libinput_event_keyboard_get_key(event);
411 code = _device_remapped_key_get(edev, code) + 8;
412 state = libinput_event_keyboard_get_key_state(event);
413 key_count = libinput_event_keyboard_get_seat_key_count(event);
415 /* ignore key events that are not seat wide state changes */
416 if (((state == LIBINPUT_KEY_STATE_PRESSED) && (key_count != 1)) ||
417 ((state == LIBINPUT_KEY_STATE_RELEASED) && (key_count != 0)))
422 xkb_state_update_key(edev->xkb.state, code,
423 (state ? XKB_KEY_DOWN : XKB_KEY_UP));
425 /* get the keysym for this code */
426 nsyms = xkb_key_get_syms(edev->xkb.state, code, &syms);
427 if (nsyms == 1) sym = syms[0];
429 /* get the keyname for this sym */
430 memset(key, 0, sizeof(key));
431 xkb_keysym_get_name(sym, key, sizeof(key));
433 memset(keyname, 0, sizeof(keyname));
434 memcpy(keyname, key, sizeof(keyname));
436 if (keyname[0] == '\0')
437 snprintf(keyname, sizeof(keyname), "Keycode-%u", code);
439 /* if shift is active, we need to transform the key to lower */
440 if (xkb_state_mod_index_is_active(edev->xkb.state,
441 xkb_map_mod_get_index(edev->xkb.keymap,
443 XKB_STATE_MODS_EFFECTIVE))
445 if (keyname[0] != '\0')
446 keyname[0] = tolower(keyname[0]);
449 memset(compose_buffer, 0, sizeof(compose_buffer));
450 if (_device_keysym_translate(sym, edev->xkb.modifiers,
451 compose_buffer, sizeof(compose_buffer)))
453 compose = eina_str_convert("ISO8859-1", "UTF-8", compose_buffer);
456 ERR("E Input cannot convert input key string '%s' to UTF-8. "
457 "Is Eina built with iconv support?", compose_buffer);
463 if (!compose) compose = compose_buffer;
465 e = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
466 ((compose[0] != '\0') ? strlen(compose) : 0) + 3);
472 key_data = E_NEW(E_Keyrouter_Event_Data, 1);
480 e->keyname = (char *)(e + 1);
481 e->key = e->keyname + strlen(keyname) + 1;
482 e->compose = strlen(compose) ? e->key + strlen(key) + 1 : NULL;
483 e->string = e->compose;
485 strncpy((char *)e->keyname, keyname, strlen(keyname));
486 strncpy((char *)e->key, key, strlen(key));
487 if (strlen(compose)) strncpy((char *)e->compose, compose, strlen(compose));
489 e->window = (Ecore_Window)input->dev->window;
490 e->event_window = (Ecore_Window)input->dev->window;
491 e->root_window = (Ecore_Window)input->dev->window;
492 e->timestamp = timestamp;
497 _device_modifiers_update(edev);
499 e->modifiers = edev->xkb.modifiers;
500 e->dev = ecore_device_ref(ecore_dev);
503 ecore_event_add(ECORE_EVENT_KEY_DOWN, e, _e_input_event_key_cb_free, NULL);
505 ecore_event_add(ECORE_EVENT_KEY_UP, e, _e_input_event_key_cb_free, NULL);
511 _device_pointer_motion(E_Input_Evdev *edev, struct libinput_event_pointer *event)
513 E_Input_Backend *input;
514 Ecore_Event_Mouse_Move *ev;
515 Ecore_Device *ecore_dev = NULL, *data, *detent_data = NULL;
518 if (!(input = edev->seat->input)) return;
520 if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
521 else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
523 EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
525 if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_MOUSE)
530 else if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_NONE)
535 if (!ecore_dev && e_devicemgr_detent_is_detent(libinput_device_get_name(edev->device)))
537 ecore_dev = detent_data;
542 edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
543 ecore_dev = edev->ecore_dev;
548 ERR("Failed to get source ecore device from event !\n");
551 else if ((detent_data == ecore_dev) || e_devicemgr_detent_is_detent(ecore_device_name_get(ecore_dev)))
553 /* Do not process detent device's move events. */
557 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
559 if (edev->seat->ptr.ix < edev->mouse.minx)
560 edev->seat->ptr.dx = edev->seat->ptr.ix = edev->mouse.minx;
561 else if (edev->seat->ptr.ix >= (edev->mouse.minx + edev->mouse.maxw))
562 edev->seat->ptr.dx = edev->seat->ptr.ix = (edev->mouse.minx + edev->mouse.maxw - 1);
564 if (edev->seat->ptr.iy < edev->mouse.miny)
565 edev->seat->ptr.dy = edev->seat->ptr.iy = edev->mouse.miny;
566 else if (edev->seat->ptr.iy >= (edev->mouse.miny + edev->mouse.maxh))
567 edev->seat->ptr.dy = edev->seat->ptr.iy = (edev->mouse.miny + edev->mouse.maxh - 1);
569 edev->mouse.dx = edev->seat->ptr.dx;
570 edev->mouse.dy = edev->seat->ptr.dy;
572 ev->window = (Ecore_Window)input->dev->window;
573 ev->event_window = (Ecore_Window)input->dev->window;
574 ev->root_window = (Ecore_Window)input->dev->window;
575 if (event) ev->timestamp = libinput_event_pointer_get_time(event);
578 _device_modifiers_update(edev);
579 ev->modifiers = edev->xkb.modifiers;
581 ev->x = edev->seat->ptr.ix;
582 ev->y = edev->seat->ptr.iy;
586 ev->multi.device = edev->mt_slot;
587 ev->multi.radius = 1;
588 ev->multi.radius_x = 1;
589 ev->multi.radius_y = 1;
590 ev->multi.pressure = 1.0;
591 ev->multi.angle = 0.0;
594 ev->multi.root.x = ev->x;
595 ev->multi.root.y = ev->y;
596 ev->dev = ecore_device_ref(ecore_dev);
598 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, _e_input_event_mouse_move_cb_free, NULL);
602 _e_input_pointer_motion_post(E_Input_Evdev *edev)
604 _device_pointer_motion(edev, NULL);
608 _device_handle_pointer_motion(struct libinput_device *device, struct libinput_event_pointer *event)
613 if (!(edev = libinput_device_get_user_data(device)))
618 dx = libinput_event_pointer_get_dx(event);
619 dy = libinput_event_pointer_get_dy(event);
621 if (edev->seat->ptr.swap)
627 if (edev->seat->ptr.invert_x)
629 if (edev->seat->ptr.invert_y)
632 edev->seat->ptr.dx += dx;
633 edev->seat->ptr.dy += dy;
635 edev->mouse.dx = edev->seat->ptr.dx;
636 edev->mouse.dy = edev->seat->ptr.dy;
638 if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
639 floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
644 edev->seat->ptr.ix = edev->seat->ptr.dx;
645 edev->seat->ptr.iy = edev->seat->ptr.dy;
647 _device_pointer_motion(edev, event);
651 _device_handle_pointer_motion_absolute(struct libinput_device *device, struct libinput_event_pointer *event)
656 if (!(edev = libinput_device_get_user_data(device)))
661 e_output_size_get(e_comp_screen_primary_output_get(e_comp->e_comp_screen), &w, &h);
663 edev->mouse.dx = edev->seat->ptr.dx =
664 libinput_event_pointer_get_absolute_x_transformed(event, w);
665 edev->mouse.dy = edev->seat->ptr.dy =
666 libinput_event_pointer_get_absolute_y_transformed(event, h);
668 if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
669 floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
674 edev->seat->ptr.ix = edev->seat->ptr.dx;
675 edev->seat->ptr.iy = edev->seat->ptr.dy;
676 _device_pointer_motion(edev, event);
680 _device_handle_button(struct libinput_device *device, struct libinput_event_pointer *event)
683 E_Input_Backend *input;
684 Ecore_Event_Mouse_Button *ev;
685 enum libinput_button_state state;
686 uint32_t button, timestamp;
687 Ecore_Device *ecore_dev = NULL, *detent_data = NULL, *data;
690 if (!(edev = libinput_device_get_user_data(device)))
694 if (!(input = edev->seat->input))
699 if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
700 else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
702 EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
704 if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_MOUSE)
709 else if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_NONE)
714 if (!ecore_dev && e_devicemgr_detent_is_detent(libinput_device_get_name(edev->device)))
716 ecore_dev = detent_data;
721 edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
722 ecore_dev = edev->ecore_dev;
727 ERR("Failed to get source ecore device from event !\n");
731 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Button))))
736 state = libinput_event_pointer_get_button_state(event);
737 button = libinput_event_pointer_get_button(event);
738 timestamp = libinput_event_pointer_get_time(event);
740 button = ((button & 0x00F) + 1);
741 if (button == 3) button = 2;
742 else if (button == 2) button = 3;
744 ev->window = (Ecore_Window)input->dev->window;
745 ev->event_window = (Ecore_Window)input->dev->window;
746 ev->root_window = (Ecore_Window)input->dev->window;
747 ev->timestamp = timestamp;
750 _device_modifiers_update(edev);
751 ev->modifiers = edev->xkb.modifiers;
753 ev->x = edev->seat->ptr.ix;
754 ev->y = edev->seat->ptr.iy;
758 ev->multi.device = edev->mt_slot;
759 ev->multi.radius = 1;
760 ev->multi.radius_x = 1;
761 ev->multi.radius_y = 1;
762 ev->multi.pressure = 1.0;
763 ev->multi.angle = 0.0;
766 ev->multi.root.x = ev->x;
767 ev->multi.root.y = ev->y;
768 ev->dev = ecore_device_ref(ecore_dev);
772 unsigned int current;
775 edev->mouse.did_double = EINA_FALSE;
776 edev->mouse.did_triple = EINA_FALSE;
778 if (((current - edev->mouse.prev) <= edev->mouse.threshold) &&
779 (button == edev->mouse.prev_button))
781 edev->mouse.did_double = EINA_TRUE;
782 if (((current - edev->mouse.last) <= (2 * edev->mouse.threshold)) &&
783 (button == edev->mouse.last_button))
785 edev->mouse.did_triple = EINA_TRUE;
786 edev->mouse.prev = 0;
787 edev->mouse.last = 0;
792 edev->mouse.last = edev->mouse.prev;
793 edev->mouse.prev = current;
794 edev->mouse.last_button = edev->mouse.prev_button;
795 edev->mouse.prev_button = button;
798 ev->buttons = button;
800 if (edev->mouse.did_double)
801 ev->double_click = 1;
802 if (edev->mouse.did_triple)
803 ev->triple_click = 1;
806 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, _e_input_event_mouse_button_cb_free, NULL);
808 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, _e_input_event_mouse_button_cb_free, NULL);
812 _device_handle_axis(struct libinput_device *device, struct libinput_event_pointer *event)
815 E_Input_Backend *input;
816 Ecore_Event_Mouse_Wheel *ev;
818 enum libinput_pointer_axis axis;
819 Ecore_Device *ecore_dev = NULL, *detent_data = NULL, *data;
822 if (!(edev = libinput_device_get_user_data(device)))
826 if (!(input = edev->seat->input))
831 if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
832 else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
834 EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
836 if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_MOUSE)
841 else if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_NONE)
846 if (!ecore_dev && e_devicemgr_detent_is_detent(libinput_device_get_name(edev->device)))
848 ecore_dev = detent_data;
853 edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
854 ecore_dev = edev->ecore_dev;
859 ERR("Failed to get source ecore device from event !\n");
863 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel))))
868 timestamp = libinput_event_pointer_get_time(event);
870 ev->window = (Ecore_Window)input->dev->window;
871 ev->event_window = (Ecore_Window)input->dev->window;
872 ev->root_window = (Ecore_Window)input->dev->window;
873 ev->timestamp = timestamp;
876 _device_modifiers_update(edev);
877 ev->modifiers = edev->xkb.modifiers;
879 ev->x = edev->seat->ptr.ix;
880 ev->y = edev->seat->ptr.iy;
883 ev->dev = ecore_device_ref(ecore_dev);
885 axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
886 if (libinput_event_pointer_has_axis(event, axis))
887 ev->z = libinput_event_pointer_get_axis_value(event, axis);
889 axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
890 if (libinput_event_pointer_has_axis(event, axis))
893 ev->z = libinput_event_pointer_get_axis_value(event, axis);
896 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, _e_input_event_mouse_wheel_cb_free, NULL);
900 _device_handle_touch_event_send(E_Input_Evdev *edev, struct libinput_event_touch *event, int state)
902 E_Input_Backend *input;
903 Ecore_Event_Mouse_Button *ev;
904 uint32_t timestamp, button = 0;
905 Ecore_Device *ecore_dev = NULL, *data;
909 if (!(input = edev->seat->input)) return;
911 if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
912 else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
914 EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
916 if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_TOUCH)
925 edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_TOUCH);
926 ecore_dev = edev->ecore_dev;
931 ERR("Failed to get source ecore device from event !\n");
935 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)))) return;
937 timestamp = libinput_event_touch_get_time(event);
939 ev->window = (Ecore_Window)input->dev->window;
940 ev->event_window = (Ecore_Window)input->dev->window;
941 ev->root_window = (Ecore_Window)input->dev->window;
942 ev->timestamp = timestamp;
945 _device_modifiers_update(edev);
946 ev->modifiers = edev->xkb.modifiers;
948 ev->x = edev->seat->ptr.ix;
949 ev->y = edev->seat->ptr.iy;
953 ev->multi.device = edev->mt_slot;
954 ev->multi.radius = 1;
955 ev->multi.radius_x = 1;
956 ev->multi.radius_y = 1;
957 ev->multi.pressure = 1.0;
958 ev->multi.angle = 0.0;
959 #if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
960 if (libinput_event_get_type(libinput_event_touch_get_base_event(event))
961 == LIBINPUT_EVENT_TOUCH_DOWN)
963 if (libinput_event_touch_has_minor(event))
964 ev->multi.radius_x = libinput_event_touch_get_minor(event);
965 if (libinput_event_touch_has_major(event))
966 ev->multi.radius_y = libinput_event_touch_get_major(event);
967 if (libinput_event_touch_has_pressure(event))
968 ev->multi.pressure = libinput_event_touch_get_pressure(event);
969 if (libinput_event_touch_has_orientation(event))
970 ev->multi.angle = libinput_event_touch_get_orientation(event);
975 ev->multi.root.x = ev->x;
976 ev->multi.root.y = ev->y;
977 ev->dev = ecore_device_ref(ecore_dev);
979 if (state == ECORE_EVENT_MOUSE_BUTTON_DOWN)
981 unsigned int current;
984 edev->mouse.did_double = EINA_FALSE;
985 edev->mouse.did_triple = EINA_FALSE;
987 if (((current - edev->mouse.prev) <= edev->mouse.threshold) &&
988 (button == edev->mouse.prev_button))
990 edev->mouse.did_double = EINA_TRUE;
991 if (((current - edev->mouse.last) <= (2 * edev->mouse.threshold)) &&
992 (button == edev->mouse.last_button))
994 edev->mouse.did_triple = EINA_TRUE;
995 edev->mouse.prev = 0;
996 edev->mouse.last = 0;
1001 edev->mouse.last = edev->mouse.prev;
1002 edev->mouse.prev = current;
1003 edev->mouse.last_button = edev->mouse.prev_button;
1004 edev->mouse.prev_button = button;
1007 ev->buttons = ((button & 0x00F) + 1);
1009 if (edev->mouse.did_double)
1010 ev->double_click = 1;
1011 if (edev->mouse.did_triple)
1012 ev->triple_click = 1;
1014 ecore_event_add(state, ev, _e_input_event_mouse_button_cb_free, NULL);
1018 _device_handle_touch_motion_send(E_Input_Evdev *edev, struct libinput_event_touch *event)
1020 E_Input_Backend *input;
1021 Ecore_Event_Mouse_Move *ev;
1022 Ecore_Device *ecore_dev = NULL, *data;
1026 if (!(input = edev->seat->input)) return;
1028 if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
1029 else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
1031 EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
1033 if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_TOUCH)
1042 edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_TOUCH);
1043 ecore_dev = edev->ecore_dev;
1048 ERR("Failed to get source ecore device from event !\n");
1052 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
1054 ev->window = (Ecore_Window)input->dev->window;
1055 ev->event_window = (Ecore_Window)input->dev->window;
1056 ev->root_window = (Ecore_Window)input->dev->window;
1057 ev->timestamp = libinput_event_touch_get_time(event);
1058 ev->same_screen = 1;
1060 _device_modifiers_update(edev);
1061 ev->modifiers = edev->xkb.modifiers;
1063 ev->x = edev->seat->ptr.ix;
1064 ev->y = edev->seat->ptr.iy;
1068 ev->multi.device = edev->mt_slot;
1069 ev->multi.radius = 1;
1070 ev->multi.radius_x = 1;
1071 ev->multi.radius_y = 1;
1072 ev->multi.pressure = 1.0;
1073 ev->multi.angle = 0.0;
1074 #if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
1075 if (libinput_event_touch_has_minor(event))
1076 ev->multi.radius_x = libinput_event_touch_get_minor(event);
1077 if (libinput_event_touch_has_major(event))
1078 ev->multi.radius_y = libinput_event_touch_get_major(event);
1079 if (libinput_event_touch_has_pressure(event))
1080 ev->multi.pressure = libinput_event_touch_get_pressure(event);
1081 if (libinput_event_touch_has_orientation(event))
1082 ev->multi.angle = libinput_event_touch_get_orientation(event);
1084 ev->multi.x = ev->x;
1085 ev->multi.y = ev->y;
1086 ev->multi.root.x = ev->x;
1087 ev->multi.root.y = ev->y;
1088 ev->dev = ecore_device_ref(ecore_dev);
1090 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, _e_input_event_mouse_move_cb_free, NULL);
1094 _device_handle_touch_down(struct libinput_device *device, struct libinput_event_touch *event)
1096 E_Input_Evdev *edev;
1099 if (!(edev = libinput_device_get_user_data(device)))
1104 e_output_size_get(e_comp_screen_primary_output_get(e_comp->e_comp_screen), &w, &h);
1106 edev->mouse.dx = edev->seat->ptr.ix = edev->seat->ptr.dx =
1107 libinput_event_touch_get_x_transformed(event, w);
1108 edev->mouse.dy = edev->seat->ptr.iy = edev->seat->ptr.dy =
1109 libinput_event_touch_get_y_transformed(event, h);
1111 edev->mt_slot = libinput_event_touch_get_slot(event);
1113 if (edev->mt_slot < E_INPUT_MAX_SLOTS)
1115 edev->touch.coords[edev->mt_slot].x = edev->seat->ptr.ix;
1116 edev->touch.coords[edev->mt_slot].y = edev->seat->ptr.iy;
1119 _device_handle_touch_motion_send(edev, event);
1120 _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_DOWN);
1124 _device_handle_touch_motion(struct libinput_device *device, struct libinput_event_touch *event)
1126 E_Input_Evdev *edev;
1129 if (!(edev = libinput_device_get_user_data(device)))
1134 e_output_size_get(e_comp_screen_primary_output_get(e_comp->e_comp_screen), &w, &h);
1136 edev->mouse.dx = edev->seat->ptr.dx =
1137 libinput_event_touch_get_x_transformed(event, w);
1138 edev->mouse.dy = edev->seat->ptr.dy =
1139 libinput_event_touch_get_y_transformed(event, h);
1141 if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
1142 floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
1147 edev->seat->ptr.ix = edev->seat->ptr.dx;
1148 edev->seat->ptr.iy = edev->seat->ptr.dy;
1150 edev->mt_slot = libinput_event_touch_get_slot(event);
1152 if (edev->mt_slot < E_INPUT_MAX_SLOTS)
1154 edev->touch.coords[edev->mt_slot].x = edev->seat->ptr.ix;
1155 edev->touch.coords[edev->mt_slot].y = edev->seat->ptr.iy;
1158 _device_handle_touch_motion_send(edev, event);
1162 _device_handle_touch_up(struct libinput_device *device, struct libinput_event_touch *event)
1164 E_Input_Evdev *edev;
1166 if (!(edev = libinput_device_get_user_data(device)))
1171 edev->mt_slot = libinput_event_touch_get_slot(event);
1173 if (edev->mt_slot < E_INPUT_MAX_SLOTS)
1175 edev->mouse.dx = edev->seat->ptr.dx = edev->seat->ptr.ix =
1176 edev->touch.coords[edev->mt_slot].x;
1177 edev->mouse.dy = edev->seat->ptr.dy = edev->seat->ptr.iy =
1178 edev->touch.coords[edev->mt_slot].y;
1181 _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_UP);
1185 _device_handle_touch_frame(struct libinput_device *device EINA_UNUSED, struct libinput_event_touch *event EINA_UNUSED)
1187 /* DBG("Unhandled Touch Frame Event"); */
1191 _e_input_aux_data_event_free(void *user_data EINA_UNUSED, void *ev)
1193 Ecore_Event_Axis_Update *e = (Ecore_Event_Axis_Update *)ev;
1195 if (e->axis) free(e->axis);
1196 if (e->dev) ecore_device_unref(e->dev);
1202 _device_handle_touch_aux_data(struct libinput_device *device, struct libinput_event_touch_aux_data *event)
1204 E_Input_Evdev *edev;
1205 E_Input_Backend *input;
1206 Ecore_Event_Axis_Update *ev;
1208 Ecore_Device *ecore_dev = NULL, *data;
1211 if (libinput_event_touch_aux_data_get_type(event) != LIBINPUT_TOUCH_AUX_DATA_TYPE_PALM &&
1212 libinput_event_touch_aux_data_get_value(event) > 0)
1215 if (!(edev = libinput_device_get_user_data(device))) goto end;
1216 if (!(input = edev->seat->input)) goto end;
1218 if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
1219 else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
1221 EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
1223 if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_TOUCH)
1232 edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_TOUCH);
1233 ecore_dev = edev->ecore_dev;
1238 ERR("Failed to get source ecore device from event !\n");
1242 if (!(ev = calloc(1, sizeof(Ecore_Event_Axis_Update))))goto end;
1244 ev->window = (Ecore_Window)input->dev->window;
1245 ev->event_window = (Ecore_Window)input->dev->window;
1246 ev->root_window = (Ecore_Window)input->dev->window;
1247 ev->timestamp = libinput_event_touch_aux_data_get_time(event);
1249 axis = (Ecore_Axis *)calloc(1, sizeof(Ecore_Axis));
1252 axis->label = ECORE_AXIS_LABEL_TOUCH_PALM;
1253 axis->value = libinput_event_touch_aux_data_get_value(event);
1257 ev->dev = ecore_device_ref(ecore_dev);
1259 ecore_event_add(ECORE_EVENT_AXIS_UPDATE, ev, _e_input_aux_data_event_free, NULL);
1266 _e_input_evdev_device_create(E_Input_Seat *seat, struct libinput_device *device)
1268 E_Input_Evdev *edev;
1269 E_Input_Backend *b_input;
1271 EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
1273 /* try to allocate space for new evdev */
1274 if (!(edev = calloc(1, sizeof(E_Input_Evdev)))) return NULL;
1277 edev->device = device;
1278 edev->path = eina_stringshare_printf("%s/%s", e_input_base_dir_get(), libinput_device_get_sysname(device));
1281 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD))
1283 edev->caps |= E_INPUT_SEAT_KEYBOARD;
1284 _device_keyboard_setup(edev);
1287 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER))
1289 edev->caps |= E_INPUT_SEAT_POINTER;
1291 /* TODO: make this configurable */
1292 edev->mouse.threshold = 250;
1294 b_input = seat->input;
1295 if (b_input->left_handed == EINA_TRUE)
1297 if (libinput_device_config_left_handed_set(device, 1) !=
1298 LIBINPUT_CONFIG_STATUS_SUCCESS)
1300 WRN("Failed to set left hand mode about device: %s\n",
1301 libinput_device_get_name(device));
1306 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH))
1309 edev->caps |= E_INPUT_SEAT_TOUCH;
1310 palm_code = libinput_device_touch_aux_data_get_code(LIBINPUT_TOUCH_AUX_DATA_TYPE_PALM);
1311 if (libinput_device_touch_has_aux_data(device, palm_code))
1313 libinput_device_touch_set_aux_data(device, palm_code);
1317 libinput_device_set_user_data(device, edev);
1318 libinput_device_ref(device);
1320 /* configure device */
1321 _device_configure(edev);
1327 _e_input_evdev_device_destroy(E_Input_Evdev *edev)
1331 EINA_SAFETY_ON_NULL_RETURN(edev);
1333 if (edev->caps & E_INPUT_SEAT_KEYBOARD)
1335 if (edev->xkb.state) xkb_state_unref(edev->xkb.state);
1336 if (edev->xkb.keymap) xkb_map_unref(edev->xkb.keymap);
1339 if (edev->ecore_dev) ecore_device_del(edev->ecore_dev);
1340 if (edev->ecore_dev_list)
1341 EINA_LIST_FREE(edev->ecore_dev_list, dev)
1343 ecore_device_del(dev);
1345 if (edev->path) eina_stringshare_del(edev->path);
1346 if (edev->device) libinput_device_unref(edev->device);
1347 if (edev->key_remap_hash) eina_hash_free(edev->key_remap_hash);
1353 _e_input_evdev_event_process(struct libinput_event *event)
1355 struct libinput_device *device;
1356 Eina_Bool ret = EINA_TRUE;
1358 device = libinput_event_get_device(event);
1359 switch (libinput_event_get_type(event))
1361 case LIBINPUT_EVENT_KEYBOARD_KEY:
1362 _device_handle_key(device, libinput_event_get_keyboard_event(event));
1364 case LIBINPUT_EVENT_POINTER_MOTION:
1365 _device_handle_pointer_motion(device,
1366 libinput_event_get_pointer_event(event));
1368 case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
1369 _device_handle_pointer_motion_absolute(device,
1370 libinput_event_get_pointer_event(event));
1372 case LIBINPUT_EVENT_POINTER_BUTTON:
1373 _device_handle_button(device, libinput_event_get_pointer_event(event));
1375 case LIBINPUT_EVENT_POINTER_AXIS:
1376 _device_handle_axis(device, libinput_event_get_pointer_event(event));
1378 case LIBINPUT_EVENT_TOUCH_DOWN:
1379 _device_handle_touch_down(device, libinput_event_get_touch_event(event));
1381 case LIBINPUT_EVENT_TOUCH_MOTION:
1382 _device_handle_touch_motion(device,
1383 libinput_event_get_touch_event(event));
1385 case LIBINPUT_EVENT_TOUCH_UP:
1386 _device_handle_touch_up(device, libinput_event_get_touch_event(event));
1388 case LIBINPUT_EVENT_TOUCH_FRAME:
1389 _device_handle_touch_frame(device, libinput_event_get_touch_event(event));
1391 case LIBINPUT_EVENT_TOUCH_AUX_DATA:
1392 _device_handle_touch_aux_data(device, libinput_event_get_touch_aux_data(event));
1403 * @brief Set the axis size of the given device.
1405 * @param dev The device to set the axis size to.
1406 * @param w The width of the axis.
1407 * @param h The height of the axis.
1409 * This function sets set the width @p w and height @p h of the axis
1410 * of device @p dev. If @p dev is a relative input device, a width and
1411 * height must set for it. If its absolute set the ioctl correctly, if
1412 * not, unsupported device.
1415 e_input_evdev_axis_size_set(E_Input_Evdev *edev, int w, int h)
1417 const char *sysname;
1422 enum libinput_config_status status;
1424 EINA_SAFETY_ON_NULL_RETURN(edev);
1425 EINA_SAFETY_ON_TRUE_RETURN((w == 0) || (h == 0));
1427 if ((!libinput_device_config_calibration_has_matrix(edev->device)) ||
1428 (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
1431 sysname = libinput_device_get_sysname(edev->device);
1433 devices = eeze_udev_find_by_subsystem_sysname("input", sysname);
1434 if (eina_list_count(devices) < 1) return;
1436 EINA_LIST_FREE(devices, device)
1438 vals = eeze_udev_syspath_get_property(device, "WL_CALIBRATION");
1440 (sscanf(vals, "%f %f %f %f %f %f",
1441 &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
1448 libinput_device_config_calibration_set_matrix(edev->device, cal);
1450 if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
1451 ERR("Failed to apply calibration");
1454 eina_stringshare_del(device);
1460 e_input_evdev_name_get(E_Input_Evdev *evdev)
1462 EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, NULL);
1463 EINA_SAFETY_ON_NULL_RETURN_VAL(evdev->device, NULL);
1465 return libinput_device_get_name(evdev->device);
1468 EINTERN const char *
1469 e_input_evdev_sysname_get(E_Input_Evdev *evdev)
1471 EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, NULL);
1472 EINA_SAFETY_ON_NULL_RETURN_VAL(evdev->device, NULL);
1474 return libinput_device_get_sysname(evdev->device);
1478 e_input_evdev_key_remap_enable(E_Input_Evdev *edev, Eina_Bool enable)
1480 EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
1481 EINA_SAFETY_ON_NULL_RETURN_VAL(edev->device, EINA_FALSE);
1483 edev->key_remap_enabled = enable;
1485 if (enable == EINA_FALSE && edev->key_remap_hash)
1487 eina_hash_free(edev->key_remap_hash);
1488 edev->key_remap_hash = NULL;
1495 e_input_evdev_key_remap_set(E_Input_Evdev *edev, int *from_keys, int *to_keys, int num)
1499 EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
1500 EINA_SAFETY_ON_NULL_RETURN_VAL(edev->device, EINA_FALSE);
1501 EINA_SAFETY_ON_NULL_RETURN_VAL(from_keys, EINA_FALSE);
1502 EINA_SAFETY_ON_NULL_RETURN_VAL(to_keys, EINA_FALSE);
1503 EINA_SAFETY_ON_TRUE_RETURN_VAL(num <= 0, EINA_FALSE);
1504 EINA_SAFETY_ON_TRUE_RETURN_VAL(!edev->key_remap_enabled, EINA_FALSE);
1506 if (edev->key_remap_hash == NULL)
1507 edev->key_remap_hash = eina_hash_int32_new(NULL);
1509 if (edev->key_remap_hash == NULL)
1511 ERR("Failed to set remap key information : creating a hash is failed.");
1515 for (i = 0; i < num ; i++)
1517 if (!from_keys[i] || !to_keys[i])
1519 ERR("Failed to set remap key information : given arguments are invalid.");
1524 for (i = 0; i < num ; i++)
1526 eina_hash_add(edev->key_remap_hash, &from_keys[i], (void *)(intptr_t)to_keys[i]);
1533 e_input_evdev_wheel_click_angle_get(E_Input_Evdev *dev)
1535 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, -1);
1536 return libinput_device_config_scroll_get_wheel_click_angle(dev->device);
1540 e_input_evdev_touch_calibration_set(E_Input_Evdev *edev, float matrix[6])
1542 EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
1543 EINA_SAFETY_ON_NULL_RETURN_VAL(edev->device, EINA_FALSE);
1545 if (!libinput_device_config_calibration_has_matrix(edev->device) ||
1546 !libinput_device_has_capability(edev->device, LIBINPUT_DEVICE_CAP_TOUCH))
1549 if (libinput_device_config_calibration_set_matrix(edev->device, matrix) !=
1550 LIBINPUT_CONFIG_STATUS_SUCCESS)
1552 WRN("Failed to set input transformation about device: %s\n",
1553 libinput_device_get_name(edev->device));
1561 e_input_evdev_mouse_accel_speed_set(E_Input_Evdev *edev, double speed)
1563 EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
1564 EINA_SAFETY_ON_NULL_RETURN_VAL(edev->device, EINA_FALSE);
1566 if (!libinput_device_has_capability(edev->device, LIBINPUT_DEVICE_CAP_POINTER))
1569 if (!libinput_device_config_accel_is_available(edev->device))
1572 if (libinput_device_config_accel_set_speed(edev->device, speed) !=
1573 LIBINPUT_CONFIG_STATUS_SUCCESS)
1575 WRN("Failed to set mouse accel about device: %s\n",
1576 libinput_device_get_name(edev->device));