Re: Mixed "pen" and multitouch input devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 15, 2012 at 9:03 PM, Chase Douglas <chasedouglas@xxxxxxxxx> wrote:
> On 03/15/2012 06:52 PM, Thorsten Wissmann wrote:
>> On Thu, Mar 15, 2012 at 11:29:37AM -0700, Chase Douglas wrote:
>>> On 03/15/2012 10:56 AM, Thorsten Wissmann wrote:
>>>> On Thu, Mar 15, 2012 at 12:27:22PM -0500, Chris Bagwell wrote:
>>>>> If you want to work with other unmodified user land apps (perhaps
>>>>> xf86-input-evdev for touches) then its probably easiest to split pen
>>>>> and touch to separate input devices.  drivers/input/tablet/wacom_wac.c
>>>>> shows some examples of that approach but that driver doesn't have to
>>>>> work to hard to split in to 2 input devices because the USB device
>>>>> already puts the events on separate USB  interfaces.
>>>>
>>>> OK. We want the device to work with the xf86-input-evdev driver. So we
>>>> will split it into two devices.
>>>
>>> Or you could teach evdev to know how to handle mixed devices :). I think
>>> that's the "better" approach over all, but it's up to you.
>>
>> Thanks! We didn't thought about this. It turned out that the problem
>> isn't caused by the usage of both BTN_TOOL_PEN and BTN_TOOL_FINGER.
>>
>> It turned out xf86-input-evdev really discards all non-multitouch events
>> (especially ABS_X and ABS_Y) events in EvdevProcessAbsoluteMotionEvent()
>> in evdev.c, if the device is configured as a multitouch device. So there
>> is a quick fix (or only workaround?), which processes ABS_X and ABS_Y
>> events even if it is a multitouch device:
>>
>> diff --git a/src/evdev.c b/src/evdev.c
>> index d540b87..b857b83 100644
>> --- a/src/evdev.c
>> +++ b/src/evdev.c
>> @@ -832,7 +832,7 @@ EvdevProcessAbsoluteMotionEvent(InputInfoPtr pInfo,
>> struct input_event *ev)
>>      if (ev->code >= ABS_MT_SLOT) {
>>          EvdevProcessTouchEvent(pInfo, ev);
>>          pEvdev->abs_queued = 1;
>> -    } else if (!pEvdev->mt_mask) {
>> +    } else if (!pEvdev->mt_mask || ev->code == ABS_X || ev->code ==
>> ABS_Y) {
>>          map = pEvdev->axis_map[ev->code];
>>          valuator_mask_set(pEvdev->vals, map, value);
>>          pEvdev->abs_queued = 1;
>>
>> This patch already is submitted to the xorg bugtracker and can be found
>> at [1].
>>
>> The only remaining question is: Does it break other drivers?
>>
>>     Max and Thorsten
>>
>> [1] https://bugs.freedesktop.org/show_bug.cgi?id=47382
>
> Great!
>
> I haven't fully thought about it enough to give a reviewed-by, but it
> seems sane.
>
> I suggest sending the patch to xorg-devel@xxxxxxxxxxx. That's where most
> patch reviews are handled. You will likely get faster results there.
>
> -- Chase

Yep, agree thats also a great way to go.

One thing I might suggest is to include with patch your thinking on
how a pen+multitouch device should send events to help in review of
the patch.  Just the basics.  For example, from above patch I have an
assumption that your sending ABS_X/Y only for PEN events and
ABS_MT_POSITION_X/Y only for touch events; but then again I'm not 100%
sure of that .

If ABS_X/Y is only for PEN events, then pEvdev->in_proximity in
xf86-input-evdev may be a less restrictive check to allow even
BTN_STYLUS and ABS_X/Y events to be processed.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux