summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-11-02 09:44:13 -0400
committerChris Michael <cp.michael@samsung.com>2016-11-02 09:58:43 -0400
commit93f7639c0d23e752ad330ab6fb1cd02d5e5d3432 (patch)
tree79eb6ab8377305d1d096d382a3ab4bc8ce5e14ae /src/lib/elput
parentc4f64a339022ab99fdc5e37162e15fbf5e6f50ca (diff)
elput: Add API to allow setting pointer acceleration profile
This patch adds an API that can be used to set a pointer acceleration profile. This API should be used when addressing T4736 ref T4736 @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/Elput.h12
-rw-r--r--src/lib/elput/elput_input.c35
2 files changed, 47 insertions, 0 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index a587b14315..bd4fe7a254 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -413,6 +413,18 @@ EAPI void elput_input_keyboard_cached_keymap_set(Elput_Manager *manager, void *k
413 */ 413 */
414EAPI Eina_Stringshare *elput_input_device_output_name_get(Elput_Device *device); 414EAPI Eina_Stringshare *elput_input_device_output_name_get(Elput_Device *device);
415 415
416/**
417 * Set the pointer acceleration profile
418 *
419 * @param manager
420 * @param seat
421 * @param profile
422 *
423 * @ingroup Elput_Input_Group
424 * @since 1.19
425 */
426EAPI void elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile);
427
416# endif 428# endif
417 429
418# undef EAPI 430# undef EAPI
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index daa3675ff6..1dde85aa88 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -638,3 +638,38 @@ elput_input_device_output_name_get(Elput_Device *device)
638 if (!device->output_name) return NULL; 638 if (!device->output_name) return NULL;
639 return eina_stringshare_ref(device->output_name); 639 return eina_stringshare_ref(device->output_name);
640} 640}
641
642EAPI void
643elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile)
644{
645 Elput_Seat *eseat;
646 Elput_Device *edev;
647 Eina_List *l, *ll;
648
649 EINA_SAFETY_ON_NULL_RETURN(manager);
650
651 /* if no seat name is passed in, just use default seat name */
652 if (!seat) seat = "seat0";
653
654 EINA_LIST_FOREACH(manager->input.seats, l, eseat)
655 {
656 if ((eseat->name) && (strcmp(eseat->name, seat)))
657 continue;
658
659 EINA_LIST_FOREACH(eseat->devices, ll, edev)
660 {
661 if (!libinput_device_has_capability(edev->device,
662 LIBINPUT_DEVICE_CAP_POINTER))
663 continue;
664
665 if (libinput_device_config_accel_set_profile(edev->device,
666 profile) !=
667 LIBINPUT_CONFIG_STATUS_SUCCESS)
668 {
669 WRN("Failed to set acceleration profile for device: %s",
670 libinput_device_get_name(edev->device));
671 continue;
672 }
673 }
674 }
675}