On Sun, Nov 14, 2010 at 4:23 PM, Ping Cheng <pingli...@gmail.com> wrote:
> On Sun, Nov 14, 2010 at 8:46 AM, <ch...@cnpbagwell.com> wrote:
> > From: Chris Bagwell <ch...@cnpbagwell.com>
> >
> > Signed-off-by: Chris Bagwell <ch...@cnpbagwell.com>
> > ---
> > src/wcmUSB.c | 16 ++++++++++------
> > 1 files changed, 10 insertions(+), 6 deletions(-)
> >
> > diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> > index 4d8a0fb..eb4d592 100644
> > --- a/src/wcmUSB.c
> > +++ b/src/wcmUSB.c
> > @@ -929,12 +929,16 @@ static int usbParseKeyEvent(WacomCommonPtr common,
> >
> > case BTN_TOUCH:
> > /* Treat BTN_TOUCH same as BTN_TOOL_DOUBLETAP
> > - * for touchpads.
> > - * TODO: Tablets that do not use wacom style
> > - * multiplexing over a single input device
> > - * also can report BTN_TOUCH same as
> > - * BTN_TOOL_PEN would be used. We should
> > - * allow for that case as well.
> > + * for generic touchscreens/Tablet PC's.
> > + *
> > + * Generic touchpads will send BTN_TOOL_FINGER
> > + * and BTN_TOUCH together. Ignore
> BTN_TOOL_FINGER
> > + * to keep same code flow for both cases.
> > + *
> > + * TODO: Generic tablets will send both
> > + * BTN_TOOL_PEN and BTN_TOUCH. This currently
> > + * gets mis-interrepted as a touch. An
> IsStylus()
> > + * is probably needed here.
>
> If both finger and pen would report BTN_TOUCH event, default BTN_TOUCH
> to touch without taking care of the pen would mess up pen data for
> sure. Also, IsStylus() can not be checked here since we do not know
> which tool is sending the data at this stage, especially if we are
> going to process serial Tablet PC, which has both pen and touch on the
> same logical port, in wcmUSB.c. The real tool will be decided in
> wcmCommon.c by commonDispatchDevice later.
>
> The issue here is the mess of BTN_TOOL_FINGER which can be a pad or a
> touch. So, let's leave BTN_TOUCH alone and focus on distinguishing
> this BTN_TOOL_FINGER (touch) from the other BTN_TOOL_FINGER (pad), if
> you know what I am talking about ;).
>
Let me preface this by saying that today's git does correctly tell
difference between those two types of BTN_TOOL_FINGER. Its just that I'm
not happy with its readability.
I sent a week or so ago a patch that modified code to not look at BTN_TOUCH
at all to increase readability which aligns with what you say above. It
only looked at BTN_TOOL_FINGER... but then because of linux-input threads it
forced me to re-remember that touchscreens do not send any BTN_TOOL_*
events.
I suspect that if/when we convert kernel Wacom Tablet PC logic to send MT
events the patch will be rejected if we attempt to send BTN_TOOL_FINGER
during touch because that is not how all other touchscreens do it.
So now I'm back to worrying about BTN_TOUCH with no BTN_TOOL_* in some
(future) cases. It just so happens that today's git handles touchscreens,
touchpads, as well as all other pre-existing Wacom cases as well.
So patch is slight clarification but pointing out issue to be addressed by
any future generic tablet (that will send BTN_TOOL_PEN). We no interest
exists for this case but we're not there quite yet.
> We send TOOL_ID for all Wacom devices in the kernel (except the new MT
> bamboo code) through:
>
> input_report_abs(input, ABS_MISC, wacom->id[0]); /* TOOL ID */
>
I'd really prefer to solve these issues within the confines of events sent
by what I'm calling "generic" touchpads, touchscreens, and pen tablets. As
an example, I plan to use my synaptics touchpad with MT events to test out
xf86-input-wacom's Bamboo touchpad logic. :-)
Its getting hard to keep our heads around all the combination of possible
events for different kinds of devices. Perhaps I should break
usbParseKeyEvent() into two functions?
usbParseGenericKeyEvent() - set up channel for generic touchpads,
touchscreens, and tablets.
usbParseProtocol45KeyEvent() - set up channel for pre-existing wacom
tablets, touchscreens and touchpads (although touchscreens and tablets look
the same in this case).
There will be a small bit of code duplication but we can get rid of all
those if/else logic.
Chris
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel