[evdev+touchscreen] BTN_TOUCH not treated as left click

Peter Hutterer peter.hutterer at who-t.net
Thu Aug 5 19:43:44 PDT 2010


On Wed, Aug 04, 2010 at 12:59:13PM +0200, _ Javi _ wrote:
> Hello,
> 
> I'm trying to make a GeneralTouch USB touchscreen to work with evdev
> driver. After some calibration, drag events work well, but when I tap
> on the screen the "Touch" event is detected but it's not treated as a
> left click and the mouse cursor doesn't move at all.
> 
> Here is the event sequence when I tap the screen:
> 
> $ evtest /dev/input/event3
> Input driver version is 1.0.0
> Input device ID: bus 0x3 vendor 0xdfc product 0x1 version 0x305
> Input device name: "USB Touchscreen 0dfc:0001"
> Supported events:
>  Event type 0 (Sync)
>  Event type 1 (Key)
>    Event code 330 (Touch)
>  Event type 3 (Absolute)
>    Event code 0 (X)
>      Value      0
>      Min        0
>      Max    32767
>    Event code 1 (Y)
>      Value      0
>      Min        0
>      Max    32767
> Testing ... (interrupt to exit)
> Event: type 3 (Absolute), code 0 (X), value 1773
> Event: type 3 (Absolute), code 1 (Y), value 1186
> Event: -------------- Report Sync ------------
> Event: type 1 (Key), code 330 (Touch), value 1
> Event: -------------- Report Sync ------------
> Event: type 1 (Key), code 330 (Touch), value 0
> 
> The event is also detectd with xinput
> $ xinput --test "USB Touchscreen 0dfc:0001"
> button press 1
> button release 1
> 
> 
> How can I bind such event to behave like a left click?
> 
> Used versions:
> X.Org X Server 1.7.6
> xf86-input-evdev 2.4.0

does the diff below fix it for you?
need to think of the wider implications for that one though. the problem is
that your device sends the coordinates before BTN_TOUCH but we don't care
about coordinates while the tool is unset (it gets set by BTN_TOUCH).
which seems a bit wrong, but I need to test this with the wacoms I have here.

Cheers,
  Peter

diff --git a/src/evdev.c b/src/evdev.c
index cd0fb6c..5ea230c 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -577,7 +577,6 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
             break;
 
         case BTN_TOUCH:
-            pEvdev->tool = value ? ev->code : 0;
             if (!(pEvdev->flags & (EVDEV_TOUCHSCREEN | EVDEV_TABLET)))
                 break;
             /* Treat BTN_TOUCH from devices that only have BTN_TOUCH as




More information about the xorg mailing list