summaryrefslogtreecommitdiff
path: root/src/lib/elput/elput_input.c
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 /src/lib/elput/elput_input.c
parent28a88bbfc883d1736827572cc1b1e3ed3dd1119b (diff)
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
Diffstat (limited to '')
-rw-r--r--src/lib/elput/elput_input.c38
1 files changed, 38 insertions, 0 deletions
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
847 } 847 }
848} 848}
849 849
850EAPI void
851elput_input_touch_tap_to_click_enabled_set(Elput_Manager *manager, const char *seat, Eina_Bool enabled)
852{
853 Elput_Seat *eseat;
854 Elput_Device *edev;
855 Eina_List *l, *ll;
856 enum libinput_config_tap_state state;
857
858 EINA_SAFETY_ON_NULL_RETURN(manager);
859
860 state = enabled ? LIBINPUT_CONFIG_TAP_ENABLED : LIBINPUT_CONFIG_TAP_DISABLED;
861
862 /* if no seat name is passed in, just use default seat name */
863 if (!seat) seat = "seat0";
864
865 EINA_LIST_FOREACH(manager->input.seats, l, eseat)
866 {
867 if ((eseat->name) && (strcmp(eseat->name, seat)))
868 continue;
869
870 EINA_LIST_FOREACH(eseat->devices, ll, edev)
871 {
872 if (!libinput_device_has_capability(edev->device,
873 LIBINPUT_DEVICE_CAP_POINTER))
874 continue;
875
876 if (libinput_device_config_tap_set_enabled(edev->device, state)
877 != LIBINPUT_CONFIG_STATUS_SUCCESS)
878 {
879 WRN("Failed to %s tap-to-click on device: %s",
880 enabled ? "enable" : "disable",
881 libinput_device_get_name(edev->device));
882 continue;
883 }
884 }
885 }
886}
887
850EAPI Elput_Seat * 888EAPI Elput_Seat *
851elput_device_seat_get(const Elput_Device *dev) 889elput_device_seat_get(const Elput_Device *dev)
852{ 890{