Signed-off-by: Ping Cheng <[email protected]>
---
 src/wcmUSB.c        |    7 +++++--
 src/xf86Wacom.c     |   17 ++++-------------
 src/xf86WacomDefs.h |    3 +++
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 1f4bc6e..398fa5e 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -975,8 +975,11 @@ static void usbParseChannel(LocalDevicePtr local, int 
channel)
                                        ds->pressure = event->value;
                        } else if (event->code == ABS_DISTANCE)
                                ds->distance = event->value;
-                       else if (event->code == ABS_WHEEL || 
-                                   event->code == ABS_Z)
+                       else if (event->code == ABS_WHEEL) {
+                               double norm = event->value * MAX_ROTATION_RANGE 
/
+                                       (double)MAX_ABS_WHEEL;
+                               ds->abswheel = (int)norm - MIN_ROTATION;
+                       } else if ( event->code == ABS_Z)
                                ds->abswheel = event->value;
                        else if (event->code == ABS_THROTTLE)
                                ds->throttle = event->value;
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 28042ed..d1c37cf 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -720,29 +720,20 @@ static int wcmRegisterX11Devices (LocalDevicePtr local)
                                -64, 63, 1, 1, 1);
        }
 
-       if ((TabletHasFeature(common, WCM_ROTATION)) && IsStylus(priv))
-               /* Art Marker Pen rotation */
+       if (IsStylus(priv))
+               /* Art Marker Pen rotation or Absolute Wheel*/
                InitValuatorAxisStruct(local->dev, 5,
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
-                               0, /* XXX what is this axis?*/
+                               XIGetKnownProperty("Rotation"), /* XXX what is 
this axis?*/
 #endif
                                -900, 899, 1, 1, 1);
        else if ((TabletHasFeature(common, WCM_RING)) && IsPad(priv))
                /* Touch ring */
                InitValuatorAxisStruct(local->dev, 5,
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
-                               0, /* XXX what is this axis?*/
-#endif
-                               0, 71, 1, 1, 1);
-       else
-       {
-               /* absolute wheel */
-               InitValuatorAxisStruct(local->dev, 5,
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
                                XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL),
 #endif
-                               0, 1023, 1, 1, 1);
-       }
+                               0, 71, 1, 1, 1);
 
        if (IsTouch(priv))
        {
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index b700431..44538ac 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -35,6 +35,9 @@
 #define MAX_SUPPRESS 100        /* max value of suppress */
 #define BUFFER_SIZE 256         /* size of reception buffer */
 #define MAXTRY 3                /* max number of try to receive magic number */
+#define MIN_ROTATION  -900      /* the minimum value of the marker pen 
rotation */
+#define MAX_ROTATION_RANGE 1800 /* the maximum range of the marker pen 
rotation */
+#define MAX_ABS_WHEEL 1023      /* the maximum value of absolute wheel */
 
 /* Default max distance to the tablet at which a proximity-out event is 
generated for
  * cursor device (e.g. mouse). 
-- 
1.7.1.1


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to