From 5cd74305c3ed86b79dfccfa7b03461830bc828ba Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Thu, 7 Jan 2016 18:19:37 +0900 Subject: [PATCH] Support extra touch events Change-Id: I80319154ddd9a160a6980cf791cd68df115d2f9d --- configure.ac | 5 +++++ src/lib/ecore_drm/ecore_drm_evdev.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) mode change 100644 => 100755 src/lib/ecore_drm/ecore_drm_evdev.c diff --git a/configure.ac b/configure.ac index 2ab86a1..e248c12 100644 --- a/configure.ac +++ b/configure.ac @@ -3233,6 +3233,11 @@ if test "x${have_libinput_new}" = "xno";then AC_DEFINE_UNQUOTED([LIBINPUT_HIGHER_08], [0], [libinput version >= 0.8]) fi +have_extra_touch_event="no" +AC_CHECK_LIB(input, libinput_event_touch_get_major, [have_extra_touch_event="yes"]) +if test "x${have_extra_touch_event}" = "xyes";then + AC_DEFINE_UNQUOTED([LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT], [1], [libinput support extra touch event]) +fi EFL_EVAL_PKGS([ECORE_DRM]) diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c old mode 100644 new mode 100755 index e3c5f06..524aef6 --- a/src/lib/ecore_drm/ecore_drm_evdev.c +++ b/src/lib/ecore_drm/ecore_drm_evdev.c @@ -715,6 +715,20 @@ _device_handle_touch_event_send(Ecore_Drm_Evdev *edev, struct libinput_event_tou ev->multi.radius_y = 1; ev->multi.pressure = 1.0; ev->multi.angle = 0.0; +#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_minor(event)) + ev->multi.radius_x = libinput_event_touch_get_minor(event); + if (libinput_event_touch_has_major(event)) + ev->multi.radius_y = libinput_event_touch_get_major(event); + if (libinput_event_touch_has_pressure(event)) + ev->multi.pressure = libinput_event_touch_get_pressure(event); + if (libinput_event_touch_has_orientation(event)) + ev->multi.angle = libinput_event_touch_get_orientation(event); + } +#endif ev->multi.x = ev->x; ev->multi.y = ev->y; ev->multi.root.x = ev->x; @@ -791,6 +805,16 @@ _device_handle_touch_motion_send(Ecore_Drm_Evdev *edev, struct libinput_event_to ev->multi.radius_y = 1; ev->multi.pressure = 1.0; ev->multi.angle = 0.0; +#if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT + if (libinput_event_touch_has_minor(event)) + ev->multi.radius_x = libinput_event_touch_get_minor(event); + if (libinput_event_touch_has_major(event)) + ev->multi.radius_y = libinput_event_touch_get_major(event); + if (libinput_event_touch_has_pressure(event)) + ev->multi.pressure = libinput_event_touch_get_pressure(event); + if (libinput_event_touch_has_orientation(event)) + ev->multi.angle = libinput_event_touch_get_orientation(event); +#endif ev->multi.x = ev->x; ev->multi.y = ev->y; ev->multi.root.x = ev->x; -- 2.7.4