summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-input_id.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-04-13 11:15:01 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2015-04-14 09:51:41 +1000
commit37186823f3868612e0cbfdc65b2562ccbda61ada (patch)
tree2ad99eefe369accc49a9a2c18b2c6d44e18e8265 /src/udev/udev-builtin-input_id.c
parent941a2aca3d92deed5bde85d744eb1d25ceba3ba2 (diff)
input_id: Identify scroll-wheel device on Trust TB7300 tablet as keyboard
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. Reported-by: Sjoerd Timmer <themba@randomdata.nl>
Diffstat (limited to 'src/udev/udev-builtin-input_id.c')
-rw-r--r--src/udev/udev-builtin-input_id.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c
index 3f3e78557b..b14190e423 100644
--- a/src/udev/udev-builtin-input_id.c
+++ b/src/udev/udev-builtin-input_id.c
@@ -265,6 +265,8 @@ static int builtin_input_id(struct udev_device *dev, int argc, char *argv[], boo
unsigned long bitmask_rel[NBITS(REL_MAX)];
unsigned long bitmask_props[NBITS(INPUT_PROP_MAX)];
const char *sysname, *devnode;
+ bool is_pointer;
+ bool is_key;
/* walk up the parental chain until we find the real input device; the
* argument is very likely a subdevice of this, like eventN */
@@ -281,9 +283,14 @@ static int builtin_input_id(struct udev_device *dev, int argc, char *argv[], boo
get_cap_mask(dev, pdev, "capabilities/rel", bitmask_rel, sizeof(bitmask_rel), test);
get_cap_mask(dev, pdev, "capabilities/key", bitmask_key, sizeof(bitmask_key), test);
get_cap_mask(dev, pdev, "properties", bitmask_props, sizeof(bitmask_props), test);
- test_pointers(dev, bitmask_ev, bitmask_abs, bitmask_key,
- bitmask_rel, bitmask_props, test);
- test_key(dev, bitmask_ev, bitmask_key, test);
+ is_pointer = test_pointers(dev, bitmask_ev, bitmask_abs,
+ bitmask_key, bitmask_rel,
+ bitmask_props, test);
+ is_key = test_key(dev, bitmask_ev, bitmask_key, test);
+ /* Some evdev nodes have only a scrollwheel */
+ if (!is_pointer && !is_key && test_bit(EV_REL, bitmask_ev) &&
+ (test_bit(REL_WHEEL, bitmask_rel) || test_bit(REL_HWHEEL, bitmask_rel)))
+ udev_builtin_add_property(dev, test, "ID_INPUT_KEY", "1");
}
devnode = udev_device_get_devnode(dev);