On Thu, Nov 25, 2010 at 02:48:15PM +1000, Peter Hutterer wrote:
> The pad has an abswheel too, normalizing this into the rotation range
> screws the coordinates.
> 
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> ---

sorry, wrong list, this is a wacom patch.

Cheers,
  Peter

>  src/wcmCommon.c |    8 ++++++--
>  src/wcmUSB.c    |    9 ++-------
>  2 files changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/src/wcmCommon.c b/src/wcmCommon.c
> index 4579578..3e6e65f 100644
> --- a/src/wcmCommon.c
> +++ b/src/wcmCommon.c
> @@ -578,17 +578,21 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
> WacomDeviceState* ds)
>       if (ds->proximity)
>               wcmRotateAndScaleCoordinates(pInfo, &x, &y);
>  
> -     if (IsCursor(priv)) 
> +     if (IsCursor(priv))
>       {
>               v3 = ds->rotation;
>               v4 = ds->throttle;
> +
> +             /* normalize abswheel airbrush data */
> +             v5 = ds->abswheel * MAX_ROTATION_RANGE/(double)MAX_ABS_WHEEL + 
> MIN_ROTATION;
> +
>       }
>       else  /* Intuos styli have tilt */
>       {
>               v3 = tx;
>               v4 = ty;
> +             v5 = ds->abswheel;
>       }
> -     v5 = ds->abswheel;
>  
>       DBG(6, priv, "%s prox=%d\tx=%d"
>               "\ty=%d\tz=%d\tv3=%d\tv4=%d\tv5=%d\tid=%d"
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 51161f0..79c05a8 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -835,13 +835,8 @@ static int usbParseAbsEvent(WacomCommonPtr common,
>                       ds->distance = event->value;
>                       break;
>               case ABS_WHEEL:
> -                     {
> -                             double norm = event->value *
> -                                     MAX_ROTATION_RANGE /
> -                                     (double)MAX_ABS_WHEEL;
> -                             ds->abswheel = (int)norm + MIN_ROTATION;
> -                             break;
> -                     }
> +                     ds->abswheel = event->value;
> +                     break;
>               case ABS_Z:
>                       ds->abswheel = event->value;
>                       break;
> -- 
> 1.7.3.2
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to