_input_event_add(evdev, state? ECORE_EVENT_MOUSE_BUTTON_DOWN : ECORE_EVENT_MOUSE_BUTTON_UP, EINA_FALSE, ev, _e_input_event_mouse_button_cb_free, NULL);
}
-#if !LIBINPUT_HAVE_SCROLL_VALUE_V120
-static int
-_axis_value_get(struct libinput_event_pointer *pointer_event, enum libinput_pointer_axis axis)
-{
- enum libinput_pointer_axis_source source;
- double value = 0.0, value_discrete = 0.0;
- int ret = 0;
- E_Comp_Config *comp_conf = NULL;
-
- comp_conf = e_comp_config_get();
- source = libinput_event_pointer_get_axis_source(pointer_event);
- switch (source)
- {
- case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL:
- value_discrete = libinput_event_pointer_get_axis_value_discrete(pointer_event, axis);
- value = libinput_event_pointer_get_axis_value(pointer_event, axis);
- if (comp_conf && comp_conf->input_log_enable)
- {
- ELOGF("Axis", "SOURCE_WHEEL discrete: %lf (cf. value: %lf)", NULL, value_discrete, value);
- }
- ret = (int)value_discrete;
- break;
- case LIBINPUT_POINTER_AXIS_SOURCE_FINGER:
- case LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS:
- value = libinput_event_pointer_get_axis_value(pointer_event, axis);
- if (comp_conf && comp_conf->input_log_enable)
- {
- ELOGF("Axis", "SOURCE_FINGER/CONTINUOUS value: %lf", NULL, value);
- }
- if (value >= E_INPUT_FINGER_SCROLL_THRESHOLD)
- ret = 1;
- else if (value <= E_INPUT_FINGER_SCROLL_THRESHOLD * (-1))
- ret = -1;
- else
- ret = 0;
- break;
- default:
- break;
- }
-
- return ret;
-}
-
-EINTERN void
-e_input_evdev_handle_axis(E_Input_Evdev *evdev, struct libinput_event_pointer *event)
-{
- E_Input_Backend *input;
- Ecore_Event_Mouse_Wheel *ev;
- uint32_t timestamp;
- enum libinput_pointer_axis axis;
- Ecore_Device *ecore_dev = NULL, *detent_data = NULL, *data;
- Eina_List *l;
- E_Comp_Config *comp_conf = NULL;
- int direction = 0, z = 0;
- const char *device_name = NULL;
- E_Input_Event_Info *input_event = NULL;
-
- EINA_SAFETY_ON_NULL_RETURN(evdev);
-
- if (!(input = e_input_seat_input_get(evdev->seat)))
- {
- return;
- }
-
- device_name = evdev->name;
- timestamp = libinput_event_pointer_get_time(event);
-
- axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
- if (libinput_event_pointer_has_axis(event, axis))
- z = _axis_value_get(event, axis);
-
- axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
- if (libinput_event_pointer_has_axis(event, axis))
- {
- direction = 1;
- z = _axis_value_get(event, axis);
- }
-
- if (z == 0)
- {
- ELOGF("Mouse", "Axis event is ignored since it has zero value", NULL);
- return;
- }
-
- comp_conf = e_comp_config_get();
- if (comp_conf && comp_conf->e_wheel_click_angle)
- {
- z = (int)(z * comp_conf->e_wheel_click_angle);
- }
-
- if ((evdev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
- (evdev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
- {
- void *blocked_client = atomic_load(&evdev->seat->dev->blocked_client);
-
- if (detent_data)
- ELOGF("Mouse", "Detent (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, blocked_client, evdev->seat->dev->server_blocked);
- else
- ELOGF("Mouse", "Wheel (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, blocked_client, evdev->seat->dev->server_blocked);
-
- return;
- }
-
- if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel)))) return;
-
- ev->window = (Ecore_Window)input->dev->window;
- ev->event_window = (Ecore_Window)input->dev->window;
- ev->root_window = (Ecore_Window)input->dev->window;
- ev->timestamp = timestamp;
- ev->same_screen = 1;
-
- _device_modifiers_update(evdev);
- ev->modifiers = evdev->xkb.modifiers;
-
- ev->x = e_input_seat_pointer_ix_get(evdev->seat);
- ev->y = e_input_seat_pointer_iy_get(evdev->seat);
- ev->root.x = ev->x;
- ev->root.y = ev->y;
- ev->z = z;
- ev->direction = direction;
-
- if (comp_conf && comp_conf->input_log_enable)
- {
- if (detent_data)
- ELOGF("Mouse", "Detent (direction: %d, value: %d)", NULL, ev->direction, ev->z);
- else
- ELOGF("Mouse", "Wheel (direction: %d, value: %d)", NULL, ev->direction, ev->z);
- }
-
- if (e_input_thread_mode_get() && e_input_pointer_thread_mode_get())
- {
- e_dev = _input_thread_mode_pointer_device_get(evdev);
- ev->dev = (Eo *)g_object_ref(e_dev);
- }
-
- _input_event_add(evdev, ECORE_EVENT_MOUSE_WHEEL, EINA_FALSE, ev, _e_input_event_mouse_wheel_cb_free, NULL);
-}
-#endif
-
-#if LIBINPUT_HAVE_SCROLL_VALUE_V120
static int
_scroll_value_get(struct libinput_event_pointer *pointer_event, enum libinput_pointer_axis axis, E_Input_Evdev_Axis_Source source)
{
_input_event_add(evdev, ECORE_EVENT_MOUSE_WHEEL, EINA_FALSE, ev, _e_input_event_mouse_wheel_cb_free, NULL);
}
-#endif
static E_Device *
_input_thread_mode_touch_device_get(E_Input_Evdev *evdev)
if (!(input = e_input_seat_input_get(evdev->seat))) return;
timestamp = libinput_event_touch_get_time(event);
-#if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
if (libinput_event_get_type(libinput_event_touch_get_base_event(event))
== LIBINPUT_EVENT_TOUCH_DOWN)
{
if (libinput_event_touch_has_orientation(event))
angle = libinput_event_touch_get_orientation(event);
}
-#endif
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)))) return;
e_input_hook_call(E_INPUT_HOOK_BOOST_MAIN_THREAD, NULL);
timestamp = libinput_event_touch_get_time(event);
-#if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
if (libinput_event_touch_has_minor(event))
radius_x = libinput_event_touch_get_minor(event);
if (libinput_event_touch_has_major(event))
pressure = libinput_event_touch_get_pressure(event);
if (libinput_event_touch_has_orientation(event))
angle = libinput_event_touch_get_orientation(event);
-#endif
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;