summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-12-14 09:04:52 -0500
committerChris Michael <cp.michael@samsung.com>2016-12-14 09:18:14 -0500
commit73a074498a18dfe5217c3eedec8be9cf1388a1dd (patch)
tree6eb6be180dd0add08f73c2a9d024b297b0dee90c
parent0f81e32433d1dedf5daf128ece3423f2b2a56098 (diff)
downloadefl-73a074498a18dfe5217c3eedec8be9cf1388a1dd.tar.gz
elput: Add API functions to get/set touchpad click method
This patch adds API functions to get or set the click method used on touch devices. The click method defines when to generate software emulated buttons @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/elput/Elput.h25
-rw-r--r--src/lib/elput/elput_touch.c20
2 files changed, 45 insertions, 0 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index 40bc2d920b..9429bdb2f9 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -540,6 +540,31 @@ EAPI Eina_Bool elput_touch_scroll_method_set(Elput_Device *device, int method);
*/
EAPI int elput_touch_scroll_method_get(Elput_Device *device);
+/**
+ * Set the button click method for a device. The button click method defines
+ * when to generate software emulated buttons
+ *
+ * @param device
+ * @param method
+ *
+ * @return EINA_TRUE on success, EINA_FALSE otherwise
+ *
+ * @ingroup Elput_Touch_Group
+ * @since 1.19
+ */
+EAPI Eina_Bool elput_touch_click_method_set(Elput_Device *device, int method);
+
+/**
+ * Get the current button click method for a device
+ *
+ * @param device
+ *
+ * @return The current button click method
+ *
+ * @ingroup Elput_Touch_Group
+ * @since 1.19
+ */
+EAPI int elput_touch_click_method_get(Elput_Device *device);
# endif
diff --git a/src/lib/elput/elput_touch.c b/src/lib/elput/elput_touch.c
index 821d33df6f..58576a2991 100644
--- a/src/lib/elput/elput_touch.c
+++ b/src/lib/elput/elput_touch.c
@@ -118,3 +118,23 @@ elput_touch_scroll_method_get(Elput_Device *device)
return libinput_device_config_scroll_get_method(device->device);
}
+
+EAPI Eina_Bool
+elput_touch_click_method_set(Elput_Device *device, int method)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
+
+ if (libinput_device_config_click_set_method(device->device, method) ==
+ LIBINPUT_CONFIG_STATUS_SUCCESS)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+EAPI int
+elput_touch_click_method_get(Elput_Device *device)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(device, -1);
+
+ return libinput_device_config_click_get_method(device->device);
+}