const struct device_float_coords *unaccelerated,
void *data, uint64_t time)
{
- const struct normalized_coords normalized = {
- .x = unaccelerated->x,
- .y = unaccelerated->y,
- };
- return normalized;
+ /* We map the unaccelerated flat filter to have the same behavior as
+ * the "accelerated" flat filter.
+ * The filter by definition is flat, i.e. it does not actually
+ * apply any acceleration (merely a constant factor) and we can assume
+ * that a user wants all mouse movement to have the same speed, mapped
+ * 1:1 to the input speed.
+ *
+ * Thus we apply the same factor to our non-accelerated motion - this way
+ * things like button scrolling end up having the same movement as
+ * pointer motion.
+ */
+ return accelerator_filter_flat(filter, unaccelerated, data, time);
}
static bool
const struct device_float_coords *unaccelerated,
void *data, uint64_t time)
{
- struct touchpad_accelerator_flat *accel =
- (struct touchpad_accelerator_flat *) filter;
- struct normalized_coords normalized;
-
- normalized = normalize_for_dpi(unaccelerated, accel->dpi);
- normalized.x = TP_MAGIC_SLOWDOWN_FLAT * normalized.x;
- normalized.y = TP_MAGIC_SLOWDOWN_FLAT * normalized.y;
-
- return normalized;
+ /* We map the unaccelerated flat filter to have the same behavior as
+ * the "accelerated" flat filter.
+ * The filter by definition is flat, i.e. it does not actually
+ * apply any acceleration (merely a constant factor) and we can assume
+ * that a user wants all mouse movement to have the same speed, mapped
+ * 1:1 to the input speed.
+ *
+ * Thus we apply the same factor to our non-accelerated motion - this way
+ * things like gestures end up having the same movement as
+ * pointer motion.
+ */
+ return accelerator_filter_touchpad_flat(filter, unaccelerated, data, time);
}
static bool