diff options
author | Chris Michael <cp.michael@samsung.com> | 2017-08-24 11:24:54 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2017-08-24 11:28:31 -0400 |
commit | d798eca247b6b2bca5cf83b9a72bc132d35dc1bc (patch) | |
tree | 2362d8d3d796708fc4701e9c36f75b96096b8650 | |
parent | 9ac1cb4fadadb667483845a1471f091f6a60780c (diff) |
elput: Add API to set pointer acceleration speed
Small patch to add an API which can be called to set pointer
acceleration speed under Wayland.
ref T4736
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r-- | src/lib/elput/Elput.h | 12 | ||||
-rw-r--r-- | src/lib/elput/elput_input.c | 35 |
2 files changed, 47 insertions, 0 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index 5636c71204..b05536130b 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h | |||
@@ -435,6 +435,18 @@ EAPI void elput_input_keyboard_group_set(Elput_Manager *manager, int group); | |||
435 | EAPI void elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile); | 435 | EAPI void elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile); |
436 | 436 | ||
437 | /** | 437 | /** |
438 | * Set the pointer acceleration speed | ||
439 | * | ||
440 | * @param manager | ||
441 | * @param seat | ||
442 | * @param speed | ||
443 | * | ||
444 | * @ingroup Elput_Input_Group | ||
445 | * @since 1.21 | ||
446 | */ | ||
447 | EAPI void elput_input_pointer_accel_speed_set(Elput_Manager *manager, const char *seat, double speed); | ||
448 | |||
449 | /** | ||
438 | * @defgroup Elput_Touch_Group Configuration of touch devices | 450 | * @defgroup Elput_Touch_Group Configuration of touch devices |
439 | * | 451 | * |
440 | * Functions related to configuration of touch devices | 452 | * Functions related to configuration of touch devices |
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 | { |