devilhorns pushed a commit to branch master.

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

commit b27ebc6294af07c6a95eefdc8a910973a14fcdc1
Author: Chris Michael <[email protected]>
Date:   Wed Dec 14 09:11:50 2016 -0500

    elput: Add API functions to get/set if tap-to-click is enabled
    
    This patch adds API functions to get or set if tap-to-click is enabled
    on a touchpad device
    
    @feature
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/elput/Elput.h       | 25 +++++++++++++++++++++++++
 src/lib/elput/elput_touch.c | 31 +++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index 9429bdb..b48caa1 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -566,6 +566,31 @@ EAPI Eina_Bool elput_touch_click_method_set(Elput_Device 
*device, int method);
  */
 EAPI int elput_touch_click_method_get(Elput_Device *device);
 
+/**
+ * Enable or disable tap-to-click on a given device
+ *
+ * @param device
+ * @param enabled
+ *
+ * @return EINA_TRUE on success, EINA_FALSE otherwise
+ *
+ * @ingroup Elput_Touch_Group
+ * @since 1.19
+ */
+EAPI Eina_Bool elput_touch_tap_enabled_set(Elput_Device *device, Eina_Bool 
enabled);
+
+/**
+ * Get if tap-to-click is enabled on a given device
+ *
+ * @param device
+ *
+ * @return EINA_TRUE if enabled, EINA_FALSE otherwise
+ *
+ * @ingroup Elput_Touch_Group
+ * @since 1.19
+ */
+EAPI Eina_Bool elput_touch_tap_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 58576a2..f761ca5 100644
--- a/src/lib/elput/elput_touch.c
+++ b/src/lib/elput/elput_touch.c
@@ -138,3 +138,34 @@ elput_touch_click_method_get(Elput_Device *device)
 
    return libinput_device_config_click_get_method(device->device);
 }
+
+EAPI Eina_Bool
+elput_touch_tap_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_enabled(device->device,
+                                                 LIBINPUT_CONFIG_TAP_ENABLED);
+     }
+   else
+     {
+        ret =
+          libinput_device_config_tap_set_enabled(device->device,
+                                                 LIBINPUT_CONFIG_TAP_DISABLED);
+     }
+
+   return ret;
+}
+
+EAPI Eina_Bool
+elput_touch_tap_enabled_get(Elput_Device *device)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
+
+   return libinput_device_config_tap_get_enabled(device->device);
+}

-- 


Reply via email to