evdev: support for touchscreens not providing BTN_TOUCH

Peter Korsgaard jacmet at sunsite.dk
Sun May 22 13:53:37 PDT 2011


>>>>> "Chris" == Chris Bagwell <chris at cnpbagwell.com> writes:

Hi,

 Chris> I don't think you can do much on xf86-input-evdev side to solve
 Chris> this issue.  The HW designers attempted to default to something
 Chris> so you could limp along until a custom driver can take over but
 Chris> they made some bad choices.

Notice that this touchscreen works out of the box on Windows without any
custom driver (just the standard HID).

 Chris> You can argue that xf86-input-evdev should be defaulting to
 Chris> TOUCHPAD or TOUCHSCREEN anytime it it detects ABS_X and ABS_Y
 Chris> but no REL_X and REL_Y.  That would get you a little further to
 Chris> usability.  At least the cursor would move around.

Indeed.

 Chris> But then the hardware is sending a left button press when you touch
 Chris> screen instead of a pressure or finger tip indication.  So you can
 Chris> move the cursor around the screen but you'll constantly be dragging
 Chris> stuff around or mis-selecting something.  There is nothing that
 Chris> xf86-input-evdev can do short of adding an optional hack to treat
 Chris> button press as finger pressure.

But we already convert BTN_TOUCH to BTN_LEFT in xf86-input-evdev?

        case BTN_TOUCH:
            /* For devices that have but don't use proximity, use
             * BTN_TOUCH as the proximity notifier */
            if (!pEvdev->use_proximity)
                pEvdev->in_proximity = value ? ev->code : 0;
            if (!(pEvdev->flags & (EVDEV_TOUCHSCREEN | EVDEV_TABLET)))
                break;
            /* Treat BTN_TOUCH from devices that only have BTN_TOUCH as
             * BTN_LEFT. */
            ev->code = BTN_LEFT;

So it should afaik just work if we would default to touchscreen rather
than mouse in this case.

Peter, would you accept a patch doing that?

 Chris> So in this case, its really best to get kernel side working right.

The controller uses the USB HID class, so there's no custom driver
involved atm.

-- 
Bye, Peter Korsgaard


More information about the xorg-devel mailing list