/*
* Not all touchpads report the same amount of units/mm (resolution).
- * Normalize motion events to a resolution of 10 units/mm as base
- * (unaccelerated) speed. This also evens out any differences in x
- * and y resolution, so that a circle on the touchpad does not turn
- * into an elipse on the screen.
+ * Normalize motion events to a resolution of 15.74 units/mm
+ * (== 400 dpi) as base (unaccelerated) speed. This also evens out any
+ * differences in x and y resolution, so that a circle on the
+ * touchpad does not turn into an elipse on the screen.
+ *
+ * We pick 400dpi as thats one of the many default resolutions
+ * for USB mice, so we end up with a similar base speed on the device.
*/
if (res_x > 1 && res_y > 1) {
- tp->accel.x_scale_coeff = 10.0 / res_x;
- tp->accel.y_scale_coeff = 10.0 / res_y;
+ tp->accel.x_scale_coeff = (400/25.4) / res_x;
+ tp->accel.y_scale_coeff = (400/25.4) / res_y;
} else {
/*
* For touchpads where the driver does not provide resolution, fall
if (accel < 1.0)
accel = 1.0;
-
+ /* We use units/ms as velocity but it has no real meaning unless all
+ devices have the same resolution. For touchpads, we normalize to
+ 400dpi (15.75 units/mm), but the resolution on USB mice is all
+ over the place. Though most mice these days have either 400
+ dpi (15.75 units/mm), 800 dpi or 1000dpi, excluding gaming mice
+ that can usually adjust it on the fly anyway and currently go up
+ to 8200dpi.
+ */
if (velocity < (threshold / 2.0))
return calc_penumbral_gradient(0.5 + velocity / threshold) * 2.0 - 1.0;