From: Anisse Astier Date: Wed, 18 Aug 2010 15:22:26 +0200 Subject: [PATCH 1/2] Fix touchscreen detection with some new USB HID touchscreens USB HID touchscreen 1cb6:6681 is detected as a tablet by evdev driver because it reports BTN_TOOL_PEN events and also has BTN_LEFT and BTN_RIGHT in its flags. Fix device type detection so that this device is detected as a touchscreen. Signed-off-by: Anisse Astier --- src/evdev.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index a609028..6d7308e 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1927,7 +1927,8 @@ EvdevProbe(InputInfoPtr pInfo) if ((TestBit(ABS_X, pEvdev->abs_bitmask) && TestBit(ABS_Y, pEvdev->abs_bitmask))) { xf86Msg(X_INFO, "%s: Found x and y absolute axes\n", pInfo->name); - if (TestBit(BTN_TOOL_PEN, pEvdev->key_bitmask)) + if (TestBit(BTN_TOOL_PEN, pEvdev->key_bitmask) && + (!TestBit(BTN_TOUCH, pEvdev->key_bitmask))) { xf86Msg(X_INFO, "%s: Found absolute tablet.\n", pInfo->name); pEvdev->flags |= EVDEV_TABLET; @@ -1938,7 +1939,8 @@ EvdevProbe(InputInfoPtr pInfo) } } else if (TestBit(ABS_PRESSURE, pEvdev->abs_bitmask) || TestBit(BTN_TOUCH, pEvdev->key_bitmask)) { - if (num_buttons || TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) { + if ((num_buttons || TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) && + (!TestBit(BTN_TOOL_PEN, pEvdev->key_bitmask))) { xf86Msg(X_INFO, "%s: Found absolute touchpad.\n", pInfo->name); pEvdev->flags |= EVDEV_TOUCHPAD; memset(pEvdev->old_vals, -1, sizeof(int) * pEvdev->num_vals); -- 1.7.0.6