Skip to contentSkip to conversation

ioemu: fix mouse wheel

PATCH New Stefano Stabellini 1 participant 1 message Dec 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ioemu: fix mouse wheel

This patch fixes the usb mouse wheel of usb devices.

hw/usb-hid.c +1 -6
diff -r 1dcac7c92479 hw/usb-hid.c
@@ -568,6 +568,7 @@
 
     dz = int_clamp(e->dz, -128, 127);
 
+    e->dz -= dz;
     if (s->xyrel) {
         dx = int_clamp(e->xdx, -128, 127);
         dy = int_clamp(e->ydy, -128, 127);
@@ -585,9 +586,6 @@
 	/* that deals with this event */
 	QUEUE_INCR(s->head);
     }
-
-    /* Appears we have to invert the wheel direction */
-    dz = 0 - dz;
 
     b = 0;
     if (e->buttons_state & MOUSE_EVENT_LBUTTON)
@@ -611,9 +609,6 @@
 	break;
 
     case USB_TABLET:
-	/* Appears we have to invert the wheel direction */
-	dz = 0 - dz;
-
 	buf[0] = b;
 	buf[1] = dx & 0xff;
 	buf[2] = dx >> 8;