This patch fixes the usb mouse wheel of usb devices.
[ Previously, tablets would fail to subtract dz from e->dz thus
producing an infinite stream of reports; also the wheel direction
inversions had been multipled by merge damage resulting in the wrong
number of inversions for mice. -iwj ]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(cherry picked from commit
70543c9952d2ff9f6fddb0a0948218e8e6f2dacb)
dz = int_clamp(e->dz, -127, 127);
+ e->dz -= dz;
if (s->xyrel) {
dx = int_clamp(e->xdx, -127, 127);
dy = int_clamp(e->ydy, -127, 127);
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;