mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-22 01:00:37 +01:00
filter: make the trackpoint accel profile func the same prototype as the others
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
831ce3c0d3
commit
6dca5df806
3 changed files with 7 additions and 26 deletions
|
|
@ -46,7 +46,8 @@ struct trackpoint_accelerator {
|
|||
double
|
||||
trackpoint_accel_profile(struct motion_filter *filter,
|
||||
void *data,
|
||||
double velocity)
|
||||
double velocity,
|
||||
uint64_t time)
|
||||
{
|
||||
struct trackpoint_accelerator *accel_filter =
|
||||
(struct trackpoint_accelerator *)filter;
|
||||
|
|
@ -82,7 +83,7 @@ trackpoint_accelerator_filter(struct motion_filter *filter,
|
|||
trackers_feed(&accel_filter->trackers, unaccelerated, time);
|
||||
velocity = trackers_velocity(&accel_filter->trackers, time);
|
||||
|
||||
f = trackpoint_accel_profile(filter, data, velocity);
|
||||
f = trackpoint_accel_profile(filter, data, velocity, time);
|
||||
coords.x = unaccelerated->x * f;
|
||||
coords.y = unaccelerated->y * f;
|
||||
|
||||
|
|
|
|||
|
|
@ -154,5 +154,6 @@ touchpad_lenovo_x230_accel_profile(struct motion_filter *filter,
|
|||
double
|
||||
trackpoint_accel_profile(struct motion_filter *filter,
|
||||
void *data,
|
||||
double delta);
|
||||
double delta,
|
||||
uint64_t time);
|
||||
#endif /* FILTER_H */
|
||||
|
|
|
|||
|
|
@ -169,24 +169,6 @@ print_accel_func(struct motion_filter *filter,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_accel_func_trackpoint(struct motion_filter *filter,
|
||||
int max)
|
||||
{
|
||||
printf("# gnuplot:\n");
|
||||
printf("# set xlabel \"deltas (units)\"\n");
|
||||
printf("# set ylabel \"raw accel factor\"\n");
|
||||
printf("# set style data lines\n");
|
||||
printf("# plot \"gnuplot.data\" using 1:2 title 'accel factor'\n");
|
||||
printf("#\n");
|
||||
printf("# data: delta(units) factor\n");
|
||||
for (double delta = 0; delta < max; delta += 0.2) {
|
||||
double factor = trackpoint_accel_profile(filter, NULL, delta);
|
||||
|
||||
printf("%.2f %f\n", delta, factor);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
|
|
@ -350,7 +332,7 @@ main(int argc, char **argv)
|
|||
profile = touchpad_lenovo_x230_accel_profile;
|
||||
} else if (streq(filter_type, "trackpoint")) {
|
||||
filter = create_pointer_accelerator_filter_trackpoint(tp_range_max);
|
||||
profile = NULL; /* trackpoint is special */
|
||||
profile = trackpoint_accel_profile;
|
||||
} else {
|
||||
fprintf(stderr, "Invalid filter type %s\n", filter_type);
|
||||
return 1;
|
||||
|
|
@ -381,10 +363,7 @@ main(int argc, char **argv)
|
|||
|
||||
switch (mode) {
|
||||
case ACCEL:
|
||||
if (!profile) /* trackpoint */
|
||||
print_accel_func_trackpoint(filter, tp_range_max);
|
||||
else
|
||||
print_accel_func(filter, profile, dpi);
|
||||
print_accel_func(filter, profile, dpi);
|
||||
break;
|
||||
case DELTA:
|
||||
print_ptraccel_deltas(filter, step);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue