[PATCH] evdev: handle touchscreens without BTN_TOUCH

Peter Korsgaard jacmet at sunsite.dk
Mon May 23 22:31:53 PDT 2011

>>>>> "Peter" == Peter Hutterer <peter.hutterer at who-t.net> writes:


 >> +++ b/src/evdev.c
 >> @@ -1683,8 +1683,10 @@ EvdevProbe(InputInfoPtr pInfo)
 pEvdev-> flags |= EVDEV_BUTTON_EVENTS;
 >> }
 >> } else if (TestBit(ABS_PRESSURE, pEvdev->abs_bitmask) ||
 >> -                TestBit(BTN_TOUCH, pEvdev->key_bitmask)) {
 >> -                if (has_lmr || TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) {
 >> +                TestBit(BTN_TOUCH, pEvdev->key_bitmask) ||
 >> +                !(TestBit(REL_X, pEvdev->rel_bitmask) &&
 >> +                  TestBit(REL_Y, pEvdev->rel_bitmask))) {
 >> +                if (TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) {

 Peter> did you drop the has_lmr intentionally?

Yes, as the touchscreen sends BTN_LEFT instead of BTN_TOUCH, has_lmr
will be true, so we cannot use it in the check.

With this change, the only thing differentiating between touchpads and
touchscreens is the presence of BTN_TOOL_FINGER.

 Peter> these checks are getting mighty confusing, I wonder if we could
 Peter> simplify this in some other way. Also, I really wonder if we
 Peter> still need all this since xserver

 Peter> commit 9f462ff9082634719e64d2d8d4dbd09ec7deaf2e 
 Peter> Refs: xorg-server-

 Peter> This should allow us to have both relative and absolute axes on
 Peter> a device and as long as we keep the mode correct, we can exceed
 Peter> the valuator range (I think).

Maybe, but that's a bit too big a change than I feel comfortable with.

 Peter> Either way, one of the things I'd like to have in ABI 14/server
 Peter> 1.12 are the proper driver hooks to change devices on-the-fly.

That sounds good.

Bye, Peter Korsgaard

More information about the xorg-devel mailing list