diff options
author | Andreas Pokorny <andreas.pokorny@canonical.com> | 2015-06-01 22:43:39 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-06-03 08:31:02 +1000 |
commit | 495968cf4e50b0380478833747c4279e19a33856 (patch) | |
tree | bad007359d9210c0638c9caac622e79156e71c70 /src/udev | |
parent | fa5a113d11453f46fc175d3b48c260bc09ff5ec4 (diff) |
udev: input_id - use ABS_MT_SLOT{-1} to exclude non touch screen devices
Peek at the ABS_MT_SLOT-1 axis. Expect that touch screens only
have axes inside the MT range.
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udev-builtin-input_id.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index ab90787f6b..e3fa4bc162 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -171,6 +171,10 @@ static bool test_pointers(struct udev_device *dev, has_mouse_button = test_bit(BTN_LEFT, bitmask_key); has_rel_coordinates = test_bit(EV_REL, bitmask_ev) && test_bit(REL_X, bitmask_rel) && test_bit(REL_Y, bitmask_rel); has_mt_coordinates = test_bit(ABS_MT_POSITION_X, bitmask_abs) && test_bit(ABS_MT_POSITION_Y, bitmask_abs); + + /* unset has_mt_coordinates if devices claims to have all abs axis */ + if(has_mt_coordinates && test_bit(ABS_MT_SLOT, bitmask_abs) && test_bit(ABS_MT_SLOT - 1, bitmask_abs)) + has_mt_coordinates = false; is_direct = test_bit(INPUT_PROP_DIRECT, bitmask_props); has_touch = test_bit(BTN_TOUCH, bitmask_key); /* joysticks don't necessarily have buttons; e. g. |