summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-12-13 13:22:29 -0500
committerChris Michael <cp.michael@samsung.com>2016-12-14 09:18:14 -0500
commit6eb34e2199e45a3f8c0784206d82746ae5face07 (patch)
tree855ea8115408b46ebb66fd1f424a43dcdd2f304c
parent0b2a32212a3e56d52a1d88c08edd646caa93a333 (diff)
downloadefl-6eb34e2199e45a3f8c0784206d82746ae5face07.tar.gz
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 <cp.michael@samsung.com>
-rw-r--r--src/lib/elput/Elput.h28
-rw-r--r--src/lib/elput/elput_touch.c31
2 files changed, 59 insertions, 0 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index 5d1bf6e162..edbd496d9f 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 330a1c5ebb..46b134ed88 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);
+}