SOURCES: twin-gpm_wheel.patch (NEW) - wheelmouse over GPM works!

witekfl witekfl at pld-linux.org
Thu Oct 4 18:19:32 CEST 2007


Author: witekfl                      Date: Thu Oct  4 16:19:32 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- wheelmouse over GPM works!

---- Files affected:
SOURCES:
   twin-gpm_wheel.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/twin-gpm_wheel.patch
diff -u /dev/null SOURCES/twin-gpm_wheel.patch:1.1
--- /dev/null	Thu Oct  4 18:19:32 2007
+++ SOURCES/twin-gpm_wheel.patch	Thu Oct  4 18:19:27 2007
@@ -0,0 +1,33 @@
+--- twin-0.5.1/server/HW/hw_tty_linux/mouse_gpm.h.old	2007-10-04 14:53:55.000000000 +0200
++++ twin-0.5.1/server/HW/hw_tty_linux/mouse_gpm.h	2007-10-04 18:05:53.000000000 +0200
+@@ -117,10 +117,10 @@
+ static void GPM_MouseEvent(int fd, display_hw hw) {
+     int left = 0;
+     udat IdButtons, Buttons = 0;
++    static udat oldWheel = 0;
+     Gpm_Event GPM_EV;
+     
+     SaveHW;
+-    
+     /*
+      * All other parts of twin read and parse data from fds in big chunks,
+      * while Gpm_GetEvent() reads and parses only a single event at time.
+@@ -170,7 +170,17 @@
+ 	    (IdButtons & GPM_B_WHEEL_FWD ? HOLD_WHEEL_FWD : 0) |
+ #endif	
+ 	    0;
+-	
++	if (GPM_EV.wdy > 0) {
++		if (oldWheel & HOLD_WHEEL_REV) oldWheel &= ~HOLD_WHEEL_REV;
++		else oldWheel |= HOLD_WHEEL_REV;
++	}
++	else if (GPM_EV.wdy < 0) {
++		if (oldWheel & HOLD_WHEEL_FWD) oldWheel &= ~HOLD_WHEEL_FWD;
++		else oldWheel |= HOLD_WHEEL_FWD;
++	} else oldWheel = 0;
++	Buttons &= ~(HOLD_WHEEL_REV|HOLD_WHEEL_FWD);
++	Buttons |= oldWheel;
++
+ 	MouseEventCommon(GPM_EV.x, GPM_EV.y, GPM_EV.dx, GPM_EV.dy, Buttons);
+ 	
+     } while (loopN-- && ioctl(GPM_fd, FIONREAD, &left) >= 0 && left > 0);
================================================================


More information about the pld-cvs-commit mailing list