devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6eb34e2199e45a3f8c0784206d82746ae5face07

commit 6eb34e2199e45a3f8c0784206d82746ae5face07
Author: Chris Michael <[email protected]>
Date:   Tue Dec 13 13:22:29 2016 -0500

    elput: Add API functions to enable/disable drag-lock on touch devices
    
    This patch adds API functions to get or set if drag-lock is enabled on
    touch devices.
    
    @feature
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/elput/Elput.h       | 28 ++++++++++++++++++++++++++++
 src/lib/elput/elput_touch.c | 31 +++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index 5d1bf6e..edbd496 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -460,6 +460,34 @@ EAPI Eina_Bool elput_touch_drag_enabled_set(Elput_Device 
*device, Eina_Bool enab
  */
 EAPI Eina_Bool elput_touch_drag_enabled_get(Elput_Device *device);
 
+/**
+ * Enable or disable drag-lock during tapping on a device. When enabled,
+ * a finger may be lifted and put back on the touchpad within a timeout and
+ * the drag process continues. When disabled, lifting the finger during a
+ * tap-and-drag will immediately stop the drag.
+ *
+ * @param device
+ * @param enable
+ *
+ * @return EINA_TRUE on sucess, EINA_FALSE otherwise
+ *
+ * @ingroup Elput_Touch_Group
+ * @since 1.19
+ */
+EAPI Eina_Bool elput_touch_drag_lock_enabled_set(Elput_Device *device, 
Eina_Bool enabled);
+
+/**
+ * Get if drag-lock is enabled on this device
+ *
+ * @param device
+ *
+ * @return EINA_TRUE if enabled, EINA_FALSE otherwise
+ *
+ * @ingroup Elput_Touch_Group
+ * @since 1.19
+ */
+EAPI Eina_Bool elput_touch_drag_lock_enabled_get(Elput_Device *device);
+
 # endif
 
 # undef EAPI
diff --git a/src/lib/elput/elput_touch.c b/src/lib/elput/elput_touch.c
index 330a1c5..46b134e 100644
--- a/src/lib/elput/elput_touch.c
+++ b/src/lib/elput/elput_touch.c
@@ -30,3 +30,34 @@ elput_touch_drag_enabled_get(Elput_Device *device)
 
    return libinput_device_config_tap_get_drag_enabled(device->device);
 }
+
+EAPI Eina_Bool
+elput_touch_drag_lock_enabled_set(Elput_Device *device, Eina_Bool enabled)
+{
+   Eina_Bool ret = EINA_FALSE;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
+
+   if (enabled)
+     {
+        ret =
+          libinput_device_config_tap_set_drag_lock_enabled(device->device,
+                                                           
LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
+     }
+   else
+     {
+        ret =
+          libinput_device_config_tap_set_drag_lock_enabled(device->device,
+                                                           
LIBINPUT_CONFIG_DRAG_LOCK_DISABLED);
+     }
+
+   return ret;
+}
+
+EAPI Eina_Bool
+elput_touch_drag_lock_enabled_get(Elput_Device *device)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
+
+   return libinput_device_config_tap_get_drag_lock_enabled(device->device);
+}

-- 


Reply via email to