On Wed, Aug 31, 2011 at 1:27 AM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> On Wed, Aug 24, 2011 at 06:57:18PM -0500, ch...@cnpbagwell.com wrote:
>> From: Chris Bagwell <ch...@cnpbagwell.com>
>>
>> Moved 4 different places were the touchscreen button press was done to a
>> single location.
>>
>> This allows to NOT send a button pressure while gesture detection
>> is being performed.  That unwanted button press could do some annoying
>> things when trying to do a 2 finger scroll on a touchscreen.
>
> just looking at the patch, wouldn't this remove the button status when
> gestures are disabled? before, the button state on isdv4 devices is always 1
> before (when touched), now it'd be 0. same with two of the usb paths too.usb
> paths too.
>

Yes, it does remove button status.  Long term, I'd like to set button
state and then have the standard logic always send button presses.  I
do not think that will work as expected because wcmGestureFilter() is
called *after* we've already done the memove() of current data into
history data in wcmEvent().  That needs some careful though how to
re-arrange.

I was trying to bring some consistency though; even if its
consistently doing it a second way.  It should make the future
alignment much easier.

For touchpad button pressures based on tapping, we were not using
button state but sending button events directly here.
For touchscreen left button press, we were using button state and
sending using normal path right and it occurred always at initial
touch.
For touchscreen right button presses, we were not using button state
but sending button events directly here.
For touchscreen gestures that do not involve left button presses, we
were doing cleanup logic to git rid of that unwanted button state from
initial touch.  Now we don't have to.

Oh yeah, I forgot that part in this version (I did do it in another
branch).  I need to remove the now unneeded logic that was releasing
touchscreen left button presses for 2 finger taps, scrolls, and zoom
gestures.

I'll take that as your comment. :-)

Chris

> Cheers,
>  Peter
>
>>
>> Signed-off-by: Chris Bagwell <ch...@cnpbagwell.com>
>> ---
>>  src/wcmISDV4.c       |    2 +-
>>  src/wcmTouchFilter.c |   27 +++++++++++++++++++++++++++
>>  src/wcmUSB.c         |   12 ------------
>>  3 files changed, 28 insertions(+), 13 deletions(-)
>>
>> diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
>> index dbc0c6a..5a123cd 100644
>> --- a/src/wcmISDV4.c
>> +++ b/src/wcmISDV4.c
>> @@ -612,7 +612,7 @@ static int isdv4ParseTouchPacket(InputInfoPtr pInfo, 
>> const unsigned char *data,
>>
>>       ds->x = touchdata.x;
>>       ds->y = touchdata.y;
>> -     ds->buttons = ds->proximity = touchdata.status;
>> +     ds->proximity = touchdata.status;
>>       ds->device_type = TOUCH_ID;
>>       ds->device_id = TOUCH_DEVICE_ID;
>>
>> diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
>> index 65b9eda..1600705 100644
>> --- a/src/wcmTouchFilter.c
>> +++ b/src/wcmTouchFilter.c
>> @@ -194,6 +194,32 @@ static void wcmSingleFingerTap(WacomDevicePtr priv)
>>       }
>>  }
>>
>> +/* Monitors for 1 finger touch and forces left button press or 1 finger
>> + * release and will remove left button press.
>> + *
>> + * This function relies on wcmGestureMode will only be zero if
>> + * WACOM_GESTURE_LAG_TIME has passed and still ony 1 finger on screen.
>> + */
>> +static void wcmSingleFingerPress(WacomDevicePtr priv)
>> +{
>> +     WacomCommonPtr common = priv->common;
>> +     WacomChannelPtr firstChannel = common->wcmChannel;
>> +     WacomChannelPtr secondChannel = common->wcmChannel + 1;
>> +     WacomDeviceState ds[2] = { firstChannel->valid.states[0],
>> +                                secondChannel->valid.states[0] };
>> +
>> +     DBG(10, priv, "\n");
>> +
>> +     /* This gesture is only valid on touchscreens. */
>> +     if (!TabletHasFeature(priv->common, WCM_LCD))
>> +             return;
>> +
>> +     if (ds[0].proximity && !ds[1].proximity)
>> +             firstChannel->valid.states[0].buttons |= 1;
>> +     if (!ds[0].proximity && !ds[1].proximity)
>> +             firstChannel->valid.states[0].buttons &= ~1;
>> +}
>> +
>>  /* parsing gesture mode according to 2FGT data */
>>  void wcmGestureFilter(WacomDevicePtr priv, int channel)
>>  {
>> @@ -341,6 +367,7 @@ ret:
>>                */
>>               if (common->wcmGesture)
>>                       wcmSingleFingerTap(priv);
>> +             wcmSingleFingerPress(priv);
>>       }
>>  }
>>
>> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
>> index 4367f19..14de990 100644
>> --- a/src/wcmUSB.c
>> +++ b/src/wcmUSB.c
>> @@ -1110,14 +1110,6 @@ 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)
>> -                             ds->buttons = mod_buttons(ds->buttons, 0,
>> -                                                       (event->value != 
>> -1));
>>                       break;
>>
>>               case ABS_MT_POSITION_X:
>> @@ -1223,7 +1215,6 @@ static int usbParseKeyEvent(WacomCommonPtr common,
>>                                       ds->device_type = TOUCH_ID;
>>                                       ds->device_id = TOUCH_DEVICE_ID;
>>                                       ds->proximity = event->value;
>> -                                     ds->buttons = mod_buttons(ds->buttons, 
>> 0, event->value);
>>                               }
>>                       }
>>                       break;
>> @@ -1253,9 +1244,6 @@ static int usbParseKeyEvent(WacomCommonPtr common,
>>                       if ((ds->proximity && !dslast->proximity) ||
>>                           (!ds->proximity && dslast->proximity))
>>                               ds->sample = (int)GetTimeInMillis();
>> -                     /* left button is always pressed for touchscreen */
>> -                     if (TabletHasFeature(common, WCM_LCD))
>> -                             ds->buttons = mod_buttons(ds->buttons, 0, 
>> event->value);
>>                       break;
>>
>>               case BTN_TOOL_TRIPLETAP:
>> --
>> 1.7.6
>>
>>
>> ------------------------------------------------------------------------------
>> EMC VNX: the world's simplest storage, starting under $10K
>> The only unified storage solution that offers unified management
>> Up to 160% more powerful than alternatives and 25% more efficient.
>> Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
>> _______________________________________________
>> Linuxwacom-devel mailing list
>> Linuxwacom-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>>
>

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to