Fixed point numbers can easily overflow, and double to fixed point
conversion is lossy. Use floating point (double) where fixed point
numbers where previously used and remove the li_fixed_t type.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
A test cannot exactly predict the resulting motion event from a given
evdev event series without having to reimplement the acceleration
algorithm. To still be able to test that sane relative motion events are
produced, check that the length and direction of the resulting motion
event vectors are close to the same as the expected vectors.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
On touchpads without physical buttons, the number of fingers on the touchpad
at the time the physical click happens decides the button type. 1/2/3 fingers
is handled left/right/middle.
We also swallow the motion event on the actual click event, this reduces
erroneous motion events by a bit. More processing is needed here though.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>