From 8a415e486a6df06ca198b503cd120205cbbc8c6e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 3 May 2016 15:03:40 +1000 Subject: [PATCH] Add tagging of trackballs Currently unused, but oh, the possibilities... The only thing we have to go on for trackballs at the moment is whether they have "Trackball" in the name string. All others need to be manually tagged. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- src/evdev.c | 1 + src/evdev.h | 1 + test/litest-device-logitech-trackball.c | 2 +- test/litest.h | 1 + udev/90-libinput-model-quirks.hwdb | 6 ++++++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/evdev.c b/src/evdev.c index 97a8fff6..7abd8953 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1736,6 +1736,7 @@ evdev_read_model_flags(struct evdev_device *device) MODEL(ALPS_RUSHMORE), MODEL(LENOVO_T450_TOUCHPAD), MODEL(WOBBLY_TOUCHPAD), + MODEL(TRACKBALL), { NULL, EVDEV_MODEL_DEFAULT }, #undef MODEL }; diff --git a/src/evdev.h b/src/evdev.h index db6d83fa..2607fd85 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -116,6 +116,7 @@ enum evdev_device_model { EVDEV_MODEL_ALPS_RUSHMORE = (1 << 16), EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17), EVDEV_MODEL_WOBBLY_TOUCHPAD = (1 << 18), + EVDEV_MODEL_TRACKBALL = (1 << 19), }; struct mt_slot { diff --git a/test/litest-device-logitech-trackball.c b/test/litest-device-logitech-trackball.c index c3b59870..1a5d8966 100644 --- a/test/litest-device-logitech-trackball.c +++ b/test/litest-device-logitech-trackball.c @@ -53,7 +53,7 @@ static int events[] = { struct litest_test_device litest_logitech_trackball_device = { .type = LITEST_LOGITECH_TRACKBALL, - .features = LITEST_RELATIVE | LITEST_BUTTON, + .features = LITEST_RELATIVE | LITEST_BUTTON | LITEST_TRACKBALL, .shortname = "logitech trackball", .setup = litest_logitech_trackball_setup, .interface = NULL, diff --git a/test/litest.h b/test/litest.h index 747512ee..211b1761 100644 --- a/test/litest.h +++ b/test/litest.h @@ -228,6 +228,7 @@ enum litest_device_feature { LITEST_TABLET_PAD = 1 << 21, LITEST_RING = 1 << 22, LITEST_STRIP = 1 << 23, + LITEST_TRACKBALL = 1 << 24, }; struct litest_device { diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb index 91ac2431..147fec25 100644 --- a/udev/90-libinput-model-quirks.hwdb +++ b/udev/90-libinput-model-quirks.hwdb @@ -146,3 +146,9 @@ libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnSystem76*pvrkudp1* ########################################## libinput:touchpad:input:b0003v056Ap* LIBINPUT_MODEL_WACOM_TOUCHPAD=1 + +########################################## +# Anything that has trackball in the name +########################################## +libinput:name:*Trackball*:dmi:* + LIBINPUT_MODEL_TRACKBALL=1