From: Chris Bagwell <chris@cnpbagwell.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Ping Cheng <pinglinux@gmail.com>,
linux-input <linux-input@vger.kernel.org>,
Jiri Kosina <jkosina@suse.cz>
Subject: Re: [RFC] Adding BTN_TOOL_TOUCH to input.h
Date: Tue, 23 Nov 2010 22:55:56 -0600 [thread overview]
Message-ID: <AANLkTi=FLyZ5eWb0M4fNg76YuzU_Cpasb3b0xjeNhLE5@mail.gmail.com> (raw)
In-Reply-To: <20101124025248.GD27368@core.coreip.homeip.net>
On Tue, Nov 23, 2010 at 8:52 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Tue, Nov 23, 2010 at 02:40:00PM -0800, Ping Cheng wrote:
>> On Tue, Nov 23, 2010 at 2:30 PM, Dmitry Torokhov
>> <dmitry.torokhov@gmail.com> wrote:
>> > On Tue, Nov 23, 2010 at 12:48:07PM -0800, Ping Cheng wrote:
>> >> Hi all,
>> >>
>> >> I am not going to write a patch for this request before I get the
>> >> permission for the new tool type. It affects all touch screen devices
>> >> (under drivers/input/touchscreen) that support both pen and touch.
>> >>
>> >> Right now, in the user land, BTN_TOUCH is used to indicate a single
>> >> touch events. BTN_TOUCH and !BTN_TOOL_PEN
>> >> (http://udev.sourcearchive.com/documentation/161-1/input__id_8c-source.html)
>> >> are used to determine if the device is a touch screen device or not a
>> >> pen. With both pen and touch on the same logical port (serial touch
>> >> screen with pen and touch enabled, refer to wacom_w8001.c), BTN_TOUCH
>> >> and !BTN_TOOL_PEN will always be false, which indicates a
>> >> non-touchscreen device. That is wrong.
>> >>
>> >> Unless we have other means to tell the user land a device is a
>> >> touchscreen, BTN_TOUCH with !BTN_TOOL_PEN won't do the job for us.
>> >>
>> >> I've already had a value for the new type:
>> >>
>> >> +#define BTN_TOOL_TOUCH 0x149
>> >>
>> >> This new type resolves the confusion we had for the existing serial
>> >> pen and touch enabled touchscreen devices. Considering we are merging
>> >> the two logical ports for USB devices, the new type is required for
>> >> the future USB touchscreen support as well.
>> >
>> > How is BTN_TOOL_TOUCH is different from BTN_TOOL_FINGER?
>>
>> Good question.
>>
>> BTN_TOOL_FINGER is used for touchpad or trackpad, or whichever term
>> that works for you. It indicates a relative cursor movement. The touch
>> screen needs to translate the (x,y) events into absolute movement.
>> That's why none of those touchscreen drivers use BTN_TOOL_FINGER so
>> far.
>>
>
> BTN_TOOL_FINGER and the new BTN_TOOL_TOUCH convey the same data to the
> userspace, namely that there is a finger on the owrking surface, as
> oopsed to pen, mouse, lens or something else. It does not dictate how
> exactly the data should be used, although right now we have heuristic to
> decide the class of the device we are dealing with.
I've a small clarification for readers that might not be aware. For
BTN_TOOL_FINGER, its still used to mean a kinda of "in proximity of
surface" and BTN_TOUCH is used when actually touching touchpad. For
touchpad, those two things probably should follow each other... but as
an example the synaptics driver only sets BTN_TOOL_FINGER immediately
but BTN_TOUCH when pressure is over some threshold. So there is a
time period when they do not match.
Touchscreens today can only send BTN_TOUCH event... which is a little
odd but works.
>
> It looks like that we getting into fuzzy area where it is hard to
> classify the device solely by its capabilities. Maybe it is time we
> revisited the topic of adding "flags" or "hint" to the device to
> describe it's main purpose(s).
>
I think the proposed BTN_TOOL_TOUCH is in the same spirit of most
other BTN_TOOL_*'s.
We seem comfortable that userland wants to know difference between pen
and eraser tools. The only thing unique they bring to table is a type
of resolution (fine tip vs. blunt tip) as well as an indication of
tool switching.
I'm not sure we needed 8 tools to express resolution concepts or tool
switching concepts but we do have them.
To me, the BTN_TOOL_TOUCH fits in just fine with this. It says its
low resolution like both BTN_TOOL_ERASER and BTN_TOOL_FINGER say to
different degrees. But it also says that, unlike BTN_TOOL_FINGER, it
has touchscreen visibility going for it to replace missing
in-proximity concept and effectively increase its resolution... and so
you do not need to revert to relative emulation.
As the udev input-id shows, I think we have pretty firm class of
devices and it seems touchscreens are only ones not cleanly defined.
It does show something is clearly missing from kernel side.
Mice - BTN_TOOL_MOUSE or anything that only has REL_* events.
Touchpads - BTN_TOOL_FINGER
Tablets - BTN_TOOL_PEN
Touchscreens - fall threw case if you don't find above.
it seems BTN_TOOL_TOUCH(screen) is probably only needed/missing value.
Are there other major classes that are not just combo devices? I
guess my point is it looks like we will not need to keep extending
BTN_TOOL_ for device classes over time.
Adding a new BTN_TOOL_TOUCH sure is less disrupted to userland as we
start to expand to support combo pen+touch devices.
If we took the flags/hint approach then BTN_TOOL_FINGER becomes pretty
meaningless for both touchpads and touchscreens.
I do also want to discuss if its OK to send BTN_TOOL_FINGER=1 and
BTN_TOOL_DOUBLETAP/TRIPLETAP=1 at same time and also proper way to
send DOUBLETAP/TRIPLETAP on touchscreens since they can't use
BTN_TOOL_FINGER today... but I'll save that for a new thread. :-)
Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-11-24 4:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-23 20:48 [RFC] Adding BTN_TOOL_TOUCH to input.h Ping Cheng
2010-11-23 22:30 ` Dmitry Torokhov
2010-11-23 22:40 ` Ping Cheng
2010-11-24 2:52 ` Dmitry Torokhov
2010-11-24 4:55 ` Chris Bagwell [this message]
2010-11-24 20:26 ` Dmitry Torokhov
2010-11-24 22:55 ` Chris Bagwell
2010-11-25 1:31 ` Dmitry Torokhov
2010-11-26 22:48 ` Chris Bagwell
2010-11-27 8:06 ` Dmitry Torokhov
-- strict thread matches above, loose matches on Subject: below --
2010-11-25 14:05 Henrik Rydberg
2010-11-25 14:12 ` Nikolai Kondrashov
2010-11-26 23:02 ` Chris Bagwell
2010-11-27 7:59 ` Dmitry Torokhov
2010-11-27 8:06 ` Nikolai Kondrashov
2010-11-27 8:32 ` Dmitry Torokhov
2010-11-27 8:51 ` Nikolai Kondrashov
[not found] ` <20101127091533.GA27213@core.coreip.homeip.net>
2010-11-27 9:46 ` Nikolai Kondrashov
2010-11-27 22:08 ` Chris Bagwell
2010-11-27 23:39 ` Dmitry Torokhov
2010-11-28 7:22 ` Dmitry Torokhov
2010-11-28 14:57 ` Nikolai Kondrashov
2010-11-28 21:47 ` Dmitry Torokhov
2010-12-07 16:59 ` Nikolai Kondrashov
2010-11-28 8:01 ` Dmitry Torokhov
2010-11-28 8:28 ` Henrik Rydberg
2010-11-28 10:14 ` Nikolai Kondrashov
2010-11-27 8:15 ` Dmitry Torokhov
2010-11-27 17:04 ` Henrik Rydberg
2010-11-27 22:22 ` Chris Bagwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTi=FLyZ5eWb0M4fNg76YuzU_Cpasb3b0xjeNhLE5@mail.gmail.com' \
--to=chris@cnpbagwell.com \
--cc=dmitry.torokhov@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=pinglinux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).