[systemd-devel] [PATCH] input_id: Identify scroll-wheel device on Trust TB7300 tablet as keyboard

Hans de Goede hdegoede at redhat.com
Sat Apr 11 06:27:46 PDT 2015


The Trust TB7300 (relabelled Waltop?) tablet has a scrollwheel which shows
up as a /dev/input/event# node all by itself. Currently input_id does not
set any ID_INPUT_FOO attr on this causing it it to not be recognized by
Xorg / libinput.

This commit fixes this by marking it with ID_INPUT_KEY.

Cc: Sjoerd Timmer <themba at randomdata.nl>
Reported-by: Sjoerd Timmer <themba at randomdata.nl>
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/udev/udev-builtin-input_id.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c
index ecfc447..f07f86e 100644
--- a/src/udev/udev-builtin-input_id.c
+++ b/src/udev/udev-builtin-input_id.c
@@ -262,6 +262,13 @@ static int builtin_input_id(struct udev_device *dev, int argc, char *argv[], boo
                 test_pointers(dev, bitmask_ev, bitmask_abs, bitmask_key,
                               bitmask_rel, bitmask_props, test);
                 test_key(dev, bitmask_ev, bitmask_key, test);
+                /*
+                 * The scrollwheel on some devices is a device all by itself,
+                 * treat this as a keyboard with just a scrollwheel.
+                 */
+                if (bitmask_ev[0] == (BIT(EV_REL) | BIT(EV_SYN)) &&
+                    bitmask_rel[0] == (bitmask_rel[0] & (BIT(REL_WHEEL) | BIT(REL_HWHEEL))))
+                        udev_builtin_add_property(dev, test, "ID_INPUT_KEY", "1");
         }
 
         devnode = udev_device_get_devnode(dev);
-- 
2.3.4



More information about the systemd-devel mailing list