[PATCH libinput 2/3] Add tagging of trackballs
Peter Hutterer
peter.hutterer at who-t.net
Tue May 3 21:13:42 UTC 2016
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 <peter.hutterer at who-t.net>
---
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 97a8fff..7abd895 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 db6d83f..2607fd8 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 c3b5987..1a5d896 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 747512e..211b176 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 91ac243..147fec2 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
--
2.7.4
More information about the wayland-devel
mailing list