Horizontal scrolling through moused /dev/sysmouse, patch

Felix Palmen felix at palmen-it.de
Fri Nov 21 14:25:52 UTC 2014


Hello all,

I had a hard time getting horizontal scrolling working with moused and 
xf86-input-mouse 1.9.0, the patch from
https://wiki.freebsd.org/SynapticsTouchpad
seems outdated.

The following extended patch works for me:


--- xf86-input-mouse-1.9.0.orig/src/mouse.c     2014-11-21 
15:12:35.000000000 +0100
+++ xf86-input-mouse-1.9.0/src/mouse.c  2014-11-21 15:10:02.000000000 +0100
@@ -969,7 +969,11 @@
      for (i = 0; i < MSE_MAXBUTTONS; i++)
          pMse->buttonMap[i] = 1 << (i > 2 && i < MSE_MAXBUTTONS-4 ? i+4 
: i);
      pMse->hasZ = 1;
-    pMse->hasW = 0;
+    if (device && strncmp(device, "/dev/sysmouse", 13) == 0) {
+        pMse->hasW = 1;
+    } else {
+        pMse->hasW = 0;
+    }

      protocol = MousePickProtocol(pInfo, device, protocol, &protocolID);

@@ -1611,6 +1615,13 @@
                   */
                  dz = ((signed char)(pBuf[5] << 1) +
                        (signed char)(pBuf[6] << 1)) >> 1;
+               if (dz == 2) {
+                   dw = 1;
+                   dz = 0;
+               } else if (dz == -2) {
+                   dw = -1;
+                   dz = 0;
+               }
                  buttons |= (int)(~pBuf[7] & 0x7f) << 3;
              }
              break;


What do you think? Ugly hack? Is there a way to determine whether moused 
actually handles a fourth axis, to avoid setting hasW=1 when there is none?


More information about the freebsd-x11 mailing list