aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-08-24 11:24:54 -0400
committerChris Michael <cp.michael@samsung.com>2017-08-24 11:28:31 -0400
commitd798eca247b6b2bca5cf83b9a72bc132d35dc1bc (patch)
tree2362d8d3d796708fc4701e9c36f75b96096b8650 /src
parenteina_value: add helper: eina_value_struct_desc_get(). (diff)
downloadefl-d798eca247b6b2bca5cf83b9a72bc132d35dc1bc.tar.gz
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 https://phab.enlightenment.org/T4736 @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-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 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);
EAPI void elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile);
/**
+ * Set the pointer acceleration speed
+ *
+ * @param manager
+ * @param seat
+ * @param speed
+ *
+ * @ingroup Elput_Input_Group
+ * @since 1.21
+ */
+EAPI void elput_input_pointer_accel_speed_set(Elput_Manager *manager, const char *seat, double speed);
+
+/**
* @defgroup Elput_Touch_Group Configuration of touch devices
*
* 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,
}
}
+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)
{