aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elput/elput_input.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/elput/elput_input.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index 5134a67635..d219eff9ff 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -775,6 +775,41 @@ elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat,
}
}
+EAPI void
+elput_input_pointer_accel_speed_set(Elput_Manager *manager, const char *seat, double speed)
+{
+ Elput_Seat *eseat;
+ Elput_Device *edev;
+ Eina_List *l, *ll;
+
+ EINA_SAFETY_ON_NULL_RETURN(manager);
+
+ /* 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_accel_set_speed(edev->device,
+ speed) !=
+ LIBINPUT_CONFIG_STATUS_SUCCESS)
+ {
+ WRN("Failed to set acceleration speed for device: %s",
+ libinput_device_get_name(edev->device));
+ continue;
+ }
+ }
+ }
+}
+
EAPI Elput_Seat *
elput_device_seat_get(const Elput_Device *dev)
{