diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2011-05-24 09:44:05 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-27 15:26:57 +1000 |
commit | 74151b3c52d989208c6ec8acadadd9bcf063bcc5 (patch) | |
tree | 8ac5b9756ff4bde834d85ff9d04876d3f3a9513a | |
parent | Add a property to toggle function key mode (diff) | |
download | xf86-input-evdev-74151b3c52d989208c6ec8acadadd9bcf063bcc5.tar.gz xf86-input-evdev-74151b3c52d989208c6ec8acadadd9bcf063bcc5.tar.bz2 xf86-input-evdev-74151b3c52d989208c6ec8acadadd9bcf063bcc5.zip |
Handle touchscreens without BTN_TOUCH
Some touchscreens (like the Lumio crystaltouch in single touch mode) send
BTN_LEFT rather than BTN_TOUCH:
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x202e product 0x5 version 0x111
Input device name: "LUMIO Inc LUMIO CrystalTouch ver 1.1C"
Supported events:
Event type 0 (Sync)
Event type 1 (Key)
Event code 272 (LeftBtn)
Event code 273 (RightBtn)
Event code 274 (MiddleBtn)
Event type 2 (Relative)
Event code 9 (Misc)
Event type 3 (Absolute)
Event code 0 (X)
Value 650
Min 0
Max 4095
Event code 1 (Y)
Value 3221
Min 0
Max 4095
Event type 4 (Misc)
Event code 4 (ScanCode)
Testing ... (interrupt to exit)
Event: time 1305882024.934011, type 4 (Misc), code 4 (ScanCode), value 90001
Event: time 1305882024.934017, type 1 (Key), code 272 (LeftBtn), value 1
Event: time 1305882024.934029, type 3 (Absolute), code 0 (X), value 270
Event: time 1305882024.934034, type 3 (Absolute), code 1 (Y), value 1513
Event: time 1305882024.934039, type 2 (Relative), code 9 (Misc), value 1
This causes evdev to handle these device as a mouse rather than a
touchscreen, which naturally doesn't work very well. We already internally
translate BTN_TOUCH as BTN_LEFT, so accept this kind of devices as
touchscreens by checking for devices with BTN_LEFT, absolute X/Y and NO
relative X/Y axes.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/evdev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c index 596eed9..0f81fb8 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1712,6 +1712,12 @@ EvdevProbe(InputInfoPtr pInfo) pEvdev->flags |= EVDEV_TOUCHSCREEN; pEvdev->flags |= EVDEV_BUTTON_EVENTS; } + } else if (!(TestBit(REL_X, pEvdev->rel_bitmask) && + TestBit(REL_Y, pEvdev->rel_bitmask)) && has_lmr) { + /* some touchscreens use BTN_LEFT rather than BTN_TOUCH */ + xf86IDrvMsg(pInfo, X_PROBED, "Found absolute touchscreen\n"); + pEvdev->flags |= EVDEV_TOUCHSCREEN; + pEvdev->flags |= EVDEV_BUTTON_EVENTS; } } } |