summaryrefslogtreecommitdiff
path: root/tools/shared.h
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-06-14 12:10:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-04-26 14:48:37 +1000
commitd8bd650540e68e8b648e76180c5eee0f19a3b893 (patch)
tree24d6c37a862015a38c03aa540fd8a51f093a21b3 /tools/shared.h
parentbd04826aa43bfbec2b974cfc2f788cec815af74c (diff)
downloadlibinput-d8bd650540e68e8b648e76180c5eee0f19a3b893.tar.gz
Expose a custom acceleration profile
This adds a third profile to the available profiles to map device-specific speed to an acceleration factor, fully defined by the caller. There has been a consistent call for different acceleration profiles in libinput, but very little specifics in what actually needs to be changed. "faster horses" and whatnot (some notable exceptions in e.g. bug 101139). Attempts to change the actual acceleration function will likely break things for others. This approach opens up the profile itself to a user-specific acceleration curve. A caller can set an acceleration curve by defining a number of points on that curve to map input speed to an output factor. That factor is applied to the input delta. libinput does relatively little besides mapping the deltas to the device-specific speed, querying the curve for that speed and applying that factor. The curve is device-specific, the input speed is in device units/ms. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/shared.h')
-rw-r--r--tools/shared.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/shared.h b/tools/shared.h
index 55e15409..dc61b5b7 100644
--- a/tools/shared.h
+++ b/tools/shared.h
@@ -50,6 +50,7 @@ enum configuration_options {
OPT_SPEED,
OPT_PROFILE,
OPT_DISABLE_SENDEVENTS,
+ OPT_CURVE_POINTS,
};
#define CONFIGURATION_OPTIONS \
@@ -73,7 +74,8 @@ enum configuration_options {
{ "set-scroll-button", required_argument, 0, OPT_SCROLL_BUTTON }, \
{ "set-profile", required_argument, 0, OPT_PROFILE }, \
{ "set-tap-map", required_argument, 0, OPT_TAP_MAP }, \
- { "set-speed", required_argument, 0, OPT_SPEED }
+ { "set-speed", required_argument, 0, OPT_SPEED }, \
+ { "set-accel-curve-points", required_argument, 0, OPT_CURVE_POINTS }
enum tools_backend {
BACKEND_DEVICE,
@@ -95,6 +97,9 @@ struct tools_options {
int dwt;
enum libinput_config_accel_profile profile;
char disable_pattern[64];
+
+ struct key_value_double *curve_points;
+ ssize_t ncurve_points;
};
void tools_init_options(struct tools_options *options);