aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichaƫl Bouchaud (yoz) <yoz@efl.so>2019-01-31 08:39:41 -0500
committerChristopher Michael <cp.michael@samsung.com>2019-01-31 08:39:41 -0500
commitebc84e82acbec68013815bbc88b90173f0d53438 (patch)
treeedd495a817cee4d35904fd761b902180557b45fb
parentelm_code: Fix formatting of error string (diff)
downloadefl-ebc84e82acbec68013815bbc88b90173f0d53438.tar.gz
elput: Add API to allow settings tap-to-click on pointer device
Summary: Add a way to configure pointer device with tap-to-click features. @feature Reviewers: ManMower, devilhorns Reviewed By: devilhorns Subscribers: devilhorns, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7843
-rw-r--r--src/lib/elput/Elput.h14
-rw-r--r--src/lib/elput/elput_input.c38
2 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index e38adf577d..a651ccfc84 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -375,6 +375,20 @@ EAPI void elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh
EAPI Eina_Bool elput_input_pointer_rotation_set(Elput_Manager *manager, int rotation);
/**
+ * Set tap-to-click status
+ *
+ * @param manager
+ * @param status
+ *
+ * @return EINA_TRUE on success, EINA_FALSE otherwise
+ *
+ * @ingroup Elput_Input_Group
+ * @since 1.22
+ */
+EAPI void elput_input_touch_tap_to_click_enabled_set(Elput_Manager *manager, const char *seat, Eina_Bool enabled);
+
+
+/**
* Calibrate input devices for given screen size
*
* @param manager
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index ca0e130002..392b157b1b 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -847,6 +847,44 @@ elput_input_pointer_accel_speed_set(Elput_Manager *manager, const char *seat, do
}
}
+EAPI void
+elput_input_touch_tap_to_click_enabled_set(Elput_Manager *manager, const char *seat, Eina_Bool enabled)
+{
+ Elput_Seat *eseat;
+ Elput_Device *edev;
+ Eina_List *l, *ll;
+ enum libinput_config_tap_state state;
+
+ EINA_SAFETY_ON_NULL_RETURN(manager);
+
+ state = enabled ? LIBINPUT_CONFIG_TAP_ENABLED : LIBINPUT_CONFIG_TAP_DISABLED;
+
+ /* if no seat name is passed in, just use default seat name */
+ if (!seat) seat = "seat0";
+
+ EINA_LIST_FOREACH(manager->input.seats, l, eseat)
+ {
+ if ((eseat->name) && (strcmp(eseat->name, seat)))
+ continue;
+
+ EINA_LIST_FOREACH(eseat->devices, ll, edev)
+ {
+ if (!libinput_device_has_capability(edev->device,
+ LIBINPUT_DEVICE_CAP_POINTER))
+ continue;
+
+ if (libinput_device_config_tap_set_enabled(edev->device, state)
+ != LIBINPUT_CONFIG_STATUS_SUCCESS)
+ {
+ WRN("Failed to %s tap-to-click on device: %s",
+ enabled ? "enable" : "disable",
+ libinput_device_get_name(edev->device));
+ continue;
+ }
+ }
+ }
+}
+
EAPI Elput_Seat *
elput_device_seat_get(const Elput_Device *dev)
{