[PATCH] handle the horizontal component of a scrollball input

Iain Hibbert plunky at rya-online.net
Mon Oct 25 01:40:32 PDT 2010


 as per https://bugs.freedesktop.org/show_bug.cgi?id=8993
---
 src/bsd_mouse.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c
index 83054eb..d16d621 100644
--- a/src/bsd_mouse.c
+++ b/src/bsd_mouse.c
@@ -53,12 +53,15 @@
 
 #define HUP_GENERIC_DESKTOP     0x0001
 #define HUP_BUTTON              0x0009
+#define HUP_CONSUMER            0x000c
 
 #define HUG_X                   0x0030
 #define HUG_Y                   0x0031
 #define HUG_Z                   0x0032
 #define HUG_WHEEL               0x0038
 
+#define HUG_AC_PAN              0x0238
+
 #define HID_USAGE2(p,u) (((p) << 16) | u)
 
 /* The UMS mices have middle button as number 3 */
@@ -496,7 +499,7 @@ typedef struct _UsbMseRec {
     hid_item_t loc_x;		/* x locator item */
     hid_item_t loc_y;		/* y locator item */
     hid_item_t loc_z;		/* z (wheel) locator item */
-    hid_item_t loc_w;		/* z (wheel) locator item */
+    hid_item_t loc_w;		/* w (pan) locator item */
     hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
    unsigned char *buffer;
 } UsbMseRec, *UsbMsePtr;
@@ -708,6 +711,9 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
     if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
 		   hid_input, &pUsbMse->loc_z, pUsbMse->iid) < 0) {
     }
+    if (hid_locate(reportDesc, HID_USAGE2(HUP_CONSUMER, HUG_AC_PAN),
+		   hid_input, &pUsbMse->loc_w, pUsbMse->iid) < 0) {
+    }
 #else
     if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
 		   hid_input, &pUsbMse->loc_x) < 0) {
@@ -720,6 +726,9 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
     if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
 		   hid_input, &pUsbMse->loc_z) < 0) {
     }
+    if (hid_locate(reportDesc, HID_USAGE2(HUP_CONSUMER, HUG_AC_PAN),
+		   hid_input, &pUsbMse->loc_w) < 0) {
+    }
 #endif
     /* Probe for number of buttons */
     for (i = 1; i <= MSE_MAXBUTTONS; i++) {
-- 
1.7.0.5





More information about the xorg-devel mailing list