On Mon, Feb 21, 2011 at 9:19 AM, <ch...@cnpbagwell.com> wrote:

> From: Chris Bagwell <ch...@cnpbagwell.com>
>
> PROTOCOL_GENERIC devices send "pad" buttons along
> with touchscreen/touchpad events.  Since we are
> emulating "pad" device concept, we need to let
> "pad" events go through when "touch" is disabled.
>
> There seems to be a popular script floating around
> that toggles "touch" device on/off by using
> same devices "pad" buttons.  This patch allows that
> to work again.
>
> Signed-off-by: Chris Bagwell <ch...@cnpbagwell.com>
> ---
>  src/wcmUSB.c |   29 +++++++++++++++--------------
>  1 files changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 4aae452..cb7bf6b 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -1312,10 +1312,6 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
>                }
>        }
>
> -       /* don't send touch event when touch isn't enabled */
> -       if ((ds->device_type == TOUCH_ID) && !common->wcmTouch)
>

I guess the root cause of the issue was device_type for PAD was not set at
this stage. If we move:

    if (private->wcmBTNChannel != channel && btn_channel_change)
    {
        /* Force to in proximity for this special case */
        btn_ds->proximity = 1;
        btn_ds->device_type = PAD_ID;
        btn_ds->device_id = PAD_DEVICE_ID;
        btn_ds->serial_num = 0xf0;
    }

or just:

    if (private->wcmBTNChannel != channel && btn_channel_change)
    {
        btn_ds->device_type = PAD_ID;
        btn_ds->device_id = PAD_DEVICE_ID;
    }

above the if statement, the rest can stay unchanged.

Ping


> -               return;
> -
>        /* DTF720 and DTF720a don't support eraser */
>        if (((common->tablet_id == 0xC0) || (common->tablet_id == 0xC2)) &&
>                (ds->device_type == ERASER_ID))
> @@ -1329,18 +1325,23 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
>        if (!ds->proximity)
>                private->wcmLastToolSerial = 0;
>
> -       /* dispatch events */
> -       if (channel_change ||
> -           (private->wcmBTNChannel == channel && btn_channel_change))
> -               wcmEvent(common, channel, ds);
> -
> -       /* dispatch for second finger.  first finger is handled above. */
> -       if (mt_channel_change)
> +       /* don't send touch event when touch isn't enabled */
> +       if (ds->device_type != TOUCH_ID || common->wcmTouch)
>        {
> -               WacomDeviceState *mt_ds;
> +               /* dispatch events */
> +               if (channel_change ||
> +                   (private->wcmBTNChannel == channel &&
> btn_channel_change))
> +                       wcmEvent(common, channel, ds);
> +
> +               /* dispatch for second finger.
> +                * first finger is handled above. */
> +               if (mt_channel_change)
> +               {
> +                       WacomDeviceState *mt_ds;
>
> -               mt_ds = &common->wcmChannel[1].work;
> -               wcmEvent(common, 1, mt_ds);
> +                       mt_ds = &common->wcmChannel[1].work;
> +                       wcmEvent(common, 1, mt_ds);
> +               }
>        }
>
>        /* dispatch butten events when re-routed */
> --
> 1.7.3.4
>
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to