handling BTN_TOUCH in evdev driver

Søren Hauberg hauberg at gmail.com
Tue Sep 23 00:57:20 PDT 2008


2008/9/23 Matthew Garrett <mjg59 at srcf.ucam.org>:
> On Tue, Sep 23, 2008 at 09:18:02AM +0200, Søren Hauberg wrote:
>
>> I guess that also depends on the kernel. The 'usbtouchscreen'  kernel
>> module only sends BTN_TOUCH, but I don't know about other modules in
>> the kernel. Anyway, I have two goals, 1) get a short term solution,
>> that'll work right now, and 2) get a long term solution that'll reduce
>> the amount of patches we have to maintain in the company. As the short
>> term solution, I've changed 'usbtouchscreen' to send BTN_LEFT instead
>> of BTN_TOUCH, and this works perfectly fine for me. So, for me,
>> changing 'evdev' to treat BTN_TOUCH like BTN_LEFT would be wonderful.
>> I don't know about other touchscreens, though...
>
> BTN_TOUCH isn't just used for touchscreens. For example, touchpads send
> it to indicate finger position. It's purely to indicate that an input
> event has been received at that location - treating it as BTN_LEFT by
> default would break existing use cases. It sounds like changing
> usbtouchscreen to send both events (at least optionally) would be more
> reasonable, but you'd probably want to discuss that with upstream.

So, is BTN_TOUCH even the right thing to send? It seems to me like a
touchpad and a touchscreen are so wildly different things, that they
should be sending the same signal. Perhaps it would be wise to
introduce a BTN_SCREENTOUCH or something similar? Of course, I can try
to persuade the kernel people that it's just fine to send BTN_LEFT
instead of BTN_TOUCH, but I'm guessing its a hard sell (BTN_TOUCH does
sound like something a touchscreen would send...)

Søren



More information about the xorg mailing list