diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/elput/elput_input.c | 35 |
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, | |||
775 | } | 775 | } |
776 | } | 776 | } |
777 | 777 | ||
778 | EAPI void | ||
779 | elput_input_pointer_accel_speed_set(Elput_Manager *manager, const char *seat, double speed) | ||
780 | { | ||
781 | Elput_Seat *eseat; | ||
782 | Elput_Device *edev; | ||
783 | Eina_List *l, *ll; | ||
784 | |||
785 | EINA_SAFETY_ON_NULL_RETURN(manager); | ||
786 | |||
787 | /* if no seat name is passed in, just use default seat name */ | ||
788 | if (!seat) seat = "seat0"; | ||
789 | |||
790 | EINA_LIST_FOREACH(manager->input.seats, l, eseat) | ||
791 | { | ||
792 | if ((eseat->name) && (strcmp(eseat->name, seat))) | ||
793 | continue; | ||
794 | |||
795 | EINA_LIST_FOREACH(eseat->devices, ll, edev) | ||
796 | { | ||
797 | if (!libinput_device_has_capability(edev->device, | ||
798 | LIBINPUT_DEVICE_CAP_POINTER)) | ||
799 | continue; | ||
800 | |||
801 | if (libinput_device_config_accel_set_speed(edev->device, | ||
802 | speed) != | ||
803 | LIBINPUT_CONFIG_STATUS_SUCCESS) | ||
804 | { | ||
805 | WRN("Failed to set acceleration speed for device: %s", | ||
806 | libinput_device_get_name(edev->device)); | ||
807 | continue; | ||
808 | } | ||
809 | } | ||
810 | } | ||
811 | } | ||
812 | |||
778 | EAPI Elput_Seat * | 813 | EAPI Elput_Seat * |
779 | elput_device_seat_get(const Elput_Device *dev) | 814 | elput_device_seat_get(const Elput_Device *dev) |
780 | { | 815 | { |