Fix libinput_device_config_send_events_get_default_mode docs

Fix libinput_device_config_send_events_get_default_mode docs referring to
itself, instead make it refer to libinput_device_config_send_events_get_mode.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add libinput_device_has_button function

In some cases the compositor will want to know which buttons a device has.

E.g. for scrolling we want the compositor to be able to set a button to change
a relative device (e.g. a trackball) into scroll mode, so that it sends
scroll-axis events instead of pointer motion events.

In order for the compositor to be able to present a sane UI for this, it needs
to know which buttons a device has.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add configuration option to select scroll mode

Add a configuration option to allow selecting between 2-finger / edge / none
scrolling (for touchpads).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
evdev: Add evdev_any_button_down helper function

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
evdev: Hookup scroll mode configuration

Keep the default behavior of middle button scrolling on trackpoints, this
allows turning off middle button scrolling on trackpoints, as well as turning
on button scrolling on trackballs.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=85535
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
touchpad: s/config/config_natural/

To avoid confusion with scroll mode configuration.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: s/test_2fg_scroll/test_trackpoint_scroll/

Fix copy and paste error, causing the function to test trackpoint scrolling
to be named test_2fg_scroll.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: Add trackpoint middle button scrolling disable test

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: Add litest_button_scroll helper function

Turn test_trackpoint_scroll into a generic helper function for testing
"button scrolling".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: Add button scroll test to pointer tests

Non trackpoint button scrolling is mainly intended for use with trackballs,
but we can test it just as well with any relative pointer device.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>