summaryrefslogtreecommitdiff
path: root/src/lib/elput
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 /src/lib/elput
parent0b2a32212a3e56d52a1d88c08edd646caa93a333 (diff)
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>
Diffstat (limited to 'src/lib/elput')
-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
460 */ 460 */
461EAPI Eina_Bool elput_touch_drag_enabled_get(Elput_Device *device); 461EAPI Eina_Bool elput_touch_drag_enabled_get(Elput_Device *device);
462 462
463/**
464 * Enable or disable drag-lock during tapping on a device. When enabled,
465 * a finger may be lifted and put back on the touchpad within a timeout and
466 * the drag process continues. When disabled, lifting the finger during a
467 * tap-and-drag will immediately stop the drag.
468 *
469 * @param device
470 * @param enable
471 *
472 * @return EINA_TRUE on sucess, EINA_FALSE otherwise
473 *
474 * @ingroup Elput_Touch_Group
475 * @since 1.19
476 */
477EAPI Eina_Bool elput_touch_drag_lock_enabled_set(Elput_Device *device, Eina_Bool enabled);
478
479/**
480 * Get if drag-lock is enabled on this device
481 *
482 * @param device
483 *
484 * @return EINA_TRUE if enabled, EINA_FALSE otherwise
485 *
486 * @ingroup Elput_Touch_Group
487 * @since 1.19
488 */
489EAPI Eina_Bool elput_touch_drag_lock_enabled_get(Elput_Device *device);
490
463# endif 491# endif
464 492
465# undef EAPI 493# 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)
30 30
31 return libinput_device_config_tap_get_drag_enabled(device->device); 31 return libinput_device_config_tap_get_drag_enabled(device->device);
32} 32}
33
34EAPI Eina_Bool
35elput_touch_drag_lock_enabled_set(Elput_Device *device, Eina_Bool enabled)
36{
37 Eina_Bool ret = EINA_FALSE;
38
39 EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
40
41 if (enabled)
42 {
43 ret =
44 libinput_device_config_tap_set_drag_lock_enabled(device->device,
45 LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
46 }
47 else
48 {
49 ret =
50 libinput_device_config_tap_set_drag_lock_enabled(device->device,
51 LIBINPUT_CONFIG_DRAG_LOCK_DISABLED);
52 }
53
54 return ret;
55}
56
57EAPI Eina_Bool
58elput_touch_drag_lock_enabled_get(Elput_Device *device)
59{
60 EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
61
62 return libinput_device_config_tap_get_drag_lock_enabled(device->device);
63}