diff options
author | Aaron Armstrong Skomra <aaron.skomra@wacom.com> | 2022-05-24 11:20:38 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2022-06-01 11:20:53 +1000 |
commit | 817e77f5a7502cc9258d1e41e5f2863a498d104f (patch) | |
tree | 3f49353cbdfa79693d01cff0be46cfa71fa47456 | |
parent | 6fd9efcd269e7bd879c62044d176007df8d659d8 (diff) | |
download | xf86-input-wacom-817e77f5a7502cc9258d1e41e5f2863a498d104f.tar.gz |
Don't report "wheel" valuator unless it exists on tool
Fixes #199
Prior to this commit we operated as if all non Art Pens needed
this valuator normalized.
Signed-off-by: Aaron Skomra <aaron.skomra@wacom.com>
-rw-r--r-- | src/wcmCommon.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 894c48b..b39a43a 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -812,6 +812,7 @@ wcmSendNonPadEvents(WacomDevicePtr priv, const WacomDeviceState *ds, } #define IsArtPen(ds) (ds->device_id == 0x885 || ds->device_id == 0x804 || ds->device_id == 0x100804) +#define IsAirBrush(ds) (ds->device_id == 0x902 || ds->device_id == 0x100902) static void wcmUpdateSerial(WacomDevicePtr priv, unsigned int serial, int id) @@ -890,17 +891,21 @@ void wcmSendEvents(WacomDevicePtr priv, const WacomDeviceState* ds) if (!ds->proximity) priv->flags &= ~SCROLLMODE_FLAG; - if (IsStylus(priv) && !IsArtPen(ds)) + if (IsStylus(priv)) { - /* Normalize abswheel airbrush data to Art Pen rotation range. - * We do not normalize Art Pen. They are already at the range. - */ - int wheel = ds->abswheel * MAX_ROTATION_RANGE/ - (double)MAX_ABS_WHEEL + MIN_ROTATION; - wcmAxisSet(&axes, WACOM_AXIS_WHEEL, wheel); - } else if (IsStylus(priv) && IsArtPen(ds)) - { - wcmAxisSet(&axes, WACOM_AXIS_WHEEL, ds->abswheel); + if (IsAirBrush(ds)) + { + /* Normalize abswheel airbrush data to Art Pen rotation range. + * We do not normalize Art Pen. They are already at the range. + */ + int wheel = ds->abswheel * MAX_ROTATION_RANGE/ + (double)MAX_ABS_WHEEL + MIN_ROTATION; + wcmAxisSet(&axes, WACOM_AXIS_WHEEL, wheel); + } + else if (IsArtPen(ds)) + { + wcmAxisSet(&axes, WACOM_AXIS_WHEEL, ds->abswheel); + } } wcmAxisDump(&axes, dump, sizeof(dump)); |