From b6b346a1cd6624d054087350181492f2f847ee28 Mon Sep 17 00:00:00 2001 From: Tim Richardson Date: Wed, 11 Apr 2018 22:57:10 +1000 Subject: [PATCH] some experimental changes to touchpad_accel_profile_linear --- src/filter.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/filter.c b/src/filter.c index 206695bb..7cda8dec 100644 --- a/src/filter.c +++ b/src/filter.c @@ -827,7 +827,8 @@ touchpad_accel_profile_linear(struct motion_filter *filter, struct pointer_accelerator *accel_filter = (struct pointer_accelerator *)filter; const double max_accel = accel_filter->accel; /* unitless factor */ - const double threshold = accel_filter->threshold; /* units/us */ + //const double threshold = accel_filter->threshold ; /* units/us */ + double threshold = 30 + 15 * filter->speed_adjustment ; /* units/us */ const double incline = accel_filter->incline; double factor; /* unitless */ @@ -868,11 +869,9 @@ touchpad_accel_profile_linear(struct motion_filter *filter, * 0.3 is chosen simply because it is above the Nyquist frequency for subpixel motion within a pixel. */ - if (speed_in < 7.0) { - factor = 0.1 * speed_in + 0.3; - /* up to the threshold, we keep factor 1, i.e. 1:1 movement */ - } else if (speed_in < threshold) { - factor = 1; + + if (speed_in < threshold) { + factor = 0.1 * speed_in; } else { /* Acceleration function above the threshold: y = ax' + b @@ -885,13 +884,15 @@ touchpad_accel_profile_linear(struct motion_filter *filter, => x' := (x - T) */ factor = incline * (speed_in - threshold) + 1; + /* Scale everything depending on the acceleration set */ + factor *= 1 + 0.5 * filter->speed_adjustment; } /* Cap at the maximum acceleration factor */ factor = min(max_accel, factor); - /* Scale everything depending on the acceleration set */ - factor *= 1 + 0.5 * filter->speed_adjustment; + printf("In filter.c touchpad_accel_profile_linear: factor: %f speed adjust: %f speed_in: %f threshold: %f incline: %f max_accel: %f\n\n",factor,filter->speed_adjustment, + speed_in,threshold,incline,max_accel); return factor * TP_MAGIC_SLOWDOWN; } -- 2.14.1