summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-05-21 12:09:42 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-05-21 12:15:25 +1000
commit33162632cb51e32851100013536f8566a68e0667 (patch)
treec21f9d03adf8efcd991d9e0e1cff7aec84797c48 /tools
parenteae33ffcf0977d18df85ac09028497e010b5c939 (diff)
Revert "Expose a custom acceleration profile"
This looked good on paper but clearly no-one (including myself) ever tested this in a real-life situation or they would've noticed that the constant factor is missing, causing a segfault on the first two-finger scroll event, touchpad gesture or button scrolling. Adding the constant factor makes the API much worse and the benefit is unclear, so out of the window it goes. We can revisit this for libinput 1.12 but this isn't going to make the next release. This reverts commit d8bd650540e68e8b648e76180c5eee0f19a3b893. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/libinput-debug-events.man10
-rw-r--r--tools/libinput-list-devices.c6
-rw-r--r--tools/ptraccel-debug.c29
-rw-r--r--tools/shared.c21
-rw-r--r--tools/shared.h7
5 files changed, 7 insertions, 66 deletions
diff --git a/tools/libinput-debug-events.man b/tools/libinput-debug-events.man
index 07674990..8a63821e 100644
--- a/tools/libinput-debug-events.man
+++ b/tools/libinput-debug-events.man
@@ -68,11 +68,6 @@ Enable or disable middle button emulation
.B \-\-enable\-dwt|\-\-disable\-dwt
Enable or disable disable-while-typing
.TP 8
-.B \-\-set\-accel-curve-points="x1:y1;x2:y2"
-Sets the curve points for the \fIcustom-speed\fR acceleration profile. The
-set of curve points is a semicolon-separate lists of key-value pairs, each
-separated by a colon. Each value is a non-negative double.
-.TP 8
.B \-\-set\-click\-method=[none|clickfinger|buttonareas]
Set the desired click method
.TP 8
@@ -82,9 +77,8 @@ Set the desired scroll method
.B \-\-set\-scroll\-button=BTN_MIDDLE
Set the button to the given button code
.TP 8
-.B \-\-set\-profile=[adaptive|flat|custom-speed]
-Set pointer acceleration profile. If the \fIcustom-speed\fR profile is
-selected, use \fB\-\-set-accel-curve-points\fR to specify the curve points.
+.B \-\-set\-profile=[adaptive|flat]
+Set pointer acceleration profile
.TP 8
.B \-\-set\-speed=<value>
Set pointer acceleration speed. The allowed range is [-1, 1].
diff --git a/tools/libinput-list-devices.c b/tools/libinput-list-devices.c
index 060d4b29..aa225ca0 100644
--- a/tools/libinput-list-devices.c
+++ b/tools/libinput-list-devices.c
@@ -205,13 +205,11 @@ accel_profiles(struct libinput_device *device)
profile = libinput_device_config_accel_get_default_profile(device);
xasprintf(&str,
- "%s%s %s%s %s%s",
+ "%s%s %s%s",
(profile == LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT) ? "*" : "",
(profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT) ? "flat" : "",
(profile == LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE) ? "*" : "",
- (profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE) ? "adaptive" : "",
- (profile == LIBINPUT_CONFIG_ACCEL_PROFILE_DEVICE_SPEED_CURVE) ? "*" : "",
- (profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_DEVICE_SPEED_CURVE) ? "custom-speed" : "");
+ (profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE) ? "adaptive" : "");
return str;
}
diff --git a/tools/ptraccel-debug.c b/tools/ptraccel-debug.c
index a98b615d..670f0457 100644
--- a/tools/ptraccel-debug.c
+++ b/tools/ptraccel-debug.c
@@ -161,12 +161,11 @@ print_accel_func(struct motion_filter *filter,
printf("# set style data lines\n");
printf("# plot \"gnuplot.data\" using 1:2 title 'accel factor'\n");
printf("#\n");
- printf("# data: velocity(mm/s) factor velocity(units/us) velocity(units/ms)\n");
+ printf("# data: velocity(mm/s) factor velocity(units/us)\n");
for (mmps = 0.0; mmps < 1000.0; mmps += 1) {
double units_per_us = mmps_to_upus(mmps, dpi);
- double units_per_ms = units_per_us * 1000;
double result = profile(filter, NULL, units_per_us, 0 /* time */);
- printf("%.8f\t%.4f\t%.8f\t%.8f\n", mmps, result, units_per_us, units_per_ms);
+ printf("%.8f\t%.4f\t%.8f\n", mmps, result, units_per_us);
}
}
@@ -244,7 +243,6 @@ main(int argc, char **argv)
const char *filter_type = "linear";
accel_profile_func_t profile = NULL;
int tp_range_max = 20;
- const char *curve_points = NULL;
enum {
OPT_HELP = 1,
@@ -256,7 +254,6 @@ main(int argc, char **argv)
OPT_DPI,
OPT_FILTER,
OPT_TRACKPOINT_RANGE,
- OPT_CURVE_POINTS,
};
while (1) {
@@ -272,7 +269,6 @@ main(int argc, char **argv)
{"dpi", 1, 0, OPT_DPI },
{"filter", 1, 0, OPT_FILTER },
{"trackpoint-range", 1, 0, OPT_TRACKPOINT_RANGE },
- {"curve-points", 1, 0, OPT_CURVE_POINTS },
{0, 0, 0, 0}
};
@@ -333,9 +329,6 @@ main(int argc, char **argv)
case OPT_TRACKPOINT_RANGE:
tp_range_max = strtod(optarg, NULL);
break;
- case OPT_CURVE_POINTS:
- curve_points = optarg;
- break;
default:
usage();
exit(1);
@@ -358,24 +351,6 @@ main(int argc, char **argv)
} else if (streq(filter_type, "trackpoint")) {
filter = create_pointer_accelerator_filter_trackpoint(tp_range_max);
profile = NULL; /* trackpoint is special */
- } else if (streq(filter_type, "custom-speed")) {
- struct key_value_double *points;
- ssize_t npoints;
-
- filter = create_pointer_accelerator_filter_custom_device_speed();
- profile = custom_accel_profile;
-
- npoints = kv_double_from_string(curve_points, ";", ":", &points);
- if (npoints <= 0)
- return 1;
-
- for (ssize_t idx = 0; idx < npoints; idx++){
- filter_set_curve_point(filter,
- points[idx].key,
- points[idx].value);
- }
-
- free(points);
} else {
fprintf(stderr, "Invalid filter type %s\n", filter_type);
return 1;
diff --git a/tools/shared.c b/tools/shared.c
index 85c0d739..c1ce6473 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -218,17 +218,6 @@ tools_parse_option(int option,
"%s",
optarg);
break;
- case OPT_CURVE_POINTS:
- if (!optarg)
- return 1;
-
- options->ncurve_points = kv_double_from_string(
- optarg,
- ";", ":",
- &options->curve_points);
- if (options->ncurve_points < 0)
- return 1;
- break;
}
return 0;
@@ -397,16 +386,6 @@ tools_device_apply_config(struct libinput_device *device,
libinput_device_config_send_events_set_mode(device,
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED);
}
-
- if (libinput_device_config_accel_get_profile(device) ==
- LIBINPUT_CONFIG_ACCEL_PROFILE_DEVICE_SPEED_CURVE) {
- for (ssize_t idx = 0; idx < options->ncurve_points; idx++) {
- double x = options->curve_points[idx].key,
- fx = options->curve_points[idx].value;
-
- libinput_device_config_accel_set_curve_point(device, x, fx);
- }
- }
}
static char*
diff --git a/tools/shared.h b/tools/shared.h
index dc61b5b7..55e15409 100644
--- a/tools/shared.h
+++ b/tools/shared.h
@@ -50,7 +50,6 @@ enum configuration_options {
OPT_SPEED,
OPT_PROFILE,
OPT_DISABLE_SENDEVENTS,
- OPT_CURVE_POINTS,
};
#define CONFIGURATION_OPTIONS \
@@ -74,8 +73,7 @@ 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-accel-curve-points", required_argument, 0, OPT_CURVE_POINTS }
+ { "set-speed", required_argument, 0, OPT_SPEED }
enum tools_backend {
BACKEND_DEVICE,
@@ -97,9 +95,6 @@ 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);