On Sat, Mar 19, 2011 at 6:49 AM, Chris Bagwell <[email protected]> wrote:

> Acked-by: Chris Bagwell <[email protected]>
>
> Ping, what do you think about this?  I'd like to put all the touch
> button clicking logic in a central location.  For example, I'd think
> the need for this is their for ISDv4 touch devices handled outside
> kernel.
>

Do you mean unify the left click function for all display devices, no matter
the data is processed in wcmUSB.c or wcmISDV4.c? That's a good idea.

The solution may be harder to implement than it sounds. If we want to enable
end users with switching the tool to relative mode (not a reasonable use
case, but who knows), the unified left click should be called in
commonDispatchDevice() when the specific tool (priv) that the event is meant
has been decided so we can check the mode before posting the click.

I'd like to put it in wcmTouchFilter and then this would allow
> bypassing the unwanted left click touchscreen's apparently get during
> 2 finger gestures.
>

That's another bonus, I agree.

This is just wishful thinking for now (I've not the time immediately)
>

Ok. Let this patch get in so people can click on the objects they want. That
will buy you some time for the unified solution.


> but wanted to get your opinion.
>

Yes, I like it very much. Thank you.

Ping


> On Fri, Mar 18, 2011 at 5:04 PM, Ping Cheng <[email protected]> wrote:
> > Tools that are in absolute mode emit left click when the tool touches
> > the surface. However, tools in relative mode need to locate the object
> > on the surface before it selects (left click on) the object. That is,
> > a second event (tap/leave/touch) is needed to trigger a left click for
> > relative mode tools.
> >
> > Tools on touchscreen is in absolute mode. So, send left click
> > down/up when the first finger touches/leaves the tablet.
> >
> > Signed-off-by: Ping Cheng <[email protected]>
> > Reviewed-by: Peter Hutterer <[email protected]>
> > ---
> > v2 changes: Updated macro MOD_BUTTONS and commit comments.
> > Added Reviewed-by.
> >  src/wcmUSB.c |   22 ++++++++++++++--------
> >  1 files changed, 14 insertions(+), 8 deletions(-)
> >
> > diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> > index 79d9ae7..cfcb6b2 100644
> > --- a/src/wcmUSB.c
> > +++ b/src/wcmUSB.c
> > @@ -979,6 +979,12 @@ static int usbParseAbsEvent(WacomCommonPtr common,
> >        return change;
> >  }
> >
> > +#define MOD_BUTTONS(bit, value) do { \
> > +       int shift = 1 << (bit); \
> > +       ds->buttons = (value ? \
> > +                       (ds->buttons | (shift)) : (ds->buttons &
> ~(shift))); \
> > +       } while (0)
> > +
> >  static int usbParseAbsMTEvent(WacomCommonPtr common, struct input_event
> *event)
> >  {
> >        int change = 1;
> > @@ -1000,6 +1006,13 @@ static int usbParseAbsMTEvent(WacomCommonPtr
> common, struct input_event *event)
> >                        ds->device_id = TOUCH_DEVICE_ID;
> >                        ds->serial_num = private->wcmMTChannel+1;
> >                        ds->sample = (int)GetTimeInMillis();
> > +
> > +                       /* Send left click down/up for touchscreen
> > +                        * when the first finger touches/leaves the
> tablet.
> > +                        */
> > +                       if (TabletHasFeature(common, WCM_LCD) &&
> > +                                       !private->wcmMTChannel)
> > +                               MOD_BUTTONS(0, event->value != -1);
> >                        break;
> >
> >                case ABS_MT_POSITION_X:
> > @@ -1039,17 +1052,10 @@ static struct
> >        { PAD_ID,    BTN_0              }
> >  };
> >
> > -#define MOD_BUTTONS(bit, value) do { \
> > -       shift = 1<<bit; \
> > -       ds->buttons = (((value) != 0) ? \
> > -                      (ds->buttons | (shift)) : (ds->buttons &
> ~(shift))); \
> > -        } while (0)
> > -
> >  static int usbParseKeyEvent(WacomCommonPtr common,
> >                            struct input_event *event, WacomDeviceState
> *ds,
> >                            WacomDeviceState *dslast)
> >  {
> > -       int shift;
> >        int change = 1;
> >
> >        /* BTN_TOOL_* are sent to indicate when a specific tool is going
> > @@ -1206,7 +1212,7 @@ static int usbParseKeyEvent(WacomCommonPtr common,
> >  static int usbParseBTNEvent(WacomCommonPtr common,
> >                            struct input_event *event, WacomDeviceState
> *ds)
> >  {
> > -       int shift, nkeys;
> > +       int nkeys;
> >        int change = 1;
> >
> >        switch (event->code)
> > --
> > 1.7.4
> >
> >
>
> >
> ------------------------------------------------------------------------------
> > Colocation vs. Managed Hosting
> > A question and answer guide to determining the best fit
> > for your organization - today and in the future.
> > http://p.sf.net/sfu/internap-sfd2d
> > _______________________________________________
> > Linuxwacom-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
> >
>
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to