[PATCH] Don't normalize the abswheel unless it's from the stylus tool.
Peter Hutterer
peter.hutterer at who-t.net
Wed Nov 24 20:58:02 PST 2010
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.hutterer at 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
More information about the xorg-devel
mailing list