Add libinput_event_pointer_get_axis_value_discrete() to count wheel clicks
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 13 Jan 2015 05:15:02 +0000 (15:15 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 14 Jan 2015 23:22:14 +0000 (09:22 +1000)
commit1daa1a11aa03dceec2d8c062112798abe7ce7ce0
tree3ed06e373cfe6677b12f1bcebe368c4f81c4da51
parentc35885e87dabdcba016cbfa124c384dd440411f1
Add libinput_event_pointer_get_axis_value_discrete() to count wheel clicks

The recent normalization of wheel events means we get the angle in degrees but
we don't know how this corresponds to clicks. The M325 has a 20 degree click
angle, most other mice have 15 degrees. So an angle of 60 can be 3 or 4 click
events.

Most clients care more about the click count than the angle on a mouse wheel.
Provide that value when needed.

Adding a discrete value to the axis event leaves the possibility of defining
discrete units for finger/continuous scroll sources in the future. Right now,
these will always reuturn 0.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad-edge-scroll.c
src/evdev.c
src/libinput-private.h
src/libinput.c
src/libinput.h
src/libinput.sym
test/pointer.c