PERFORCE change 177279 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Fri Apr 23 19:32:58 UTC 2010
http://p4web.freebsd.org/@@177279?ac=10
Change 177279 by hselasky at hselasky_laptop001 on 2010/04/23 19:32:37
USB input:
- patch from "Henry Hu" to enable support for
mouse panning wheels.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/input/ums.c#28 edit
.. //depot/projects/usb/src/sys/dev/usb/usbhid.h#12 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/input/ums.c#28 (text+ko) ====
@@ -286,6 +286,12 @@
DPRINTFN(6, "x:%d y:%d z:%d t:%d w:%d buttons:0x%08x\n",
dx, dy, dz, dt, dw, buttons);
+ /* translate T-axis into button presses until further */
+ if (dt > 0)
+ buttons |= 1UL << 3;
+ else if (dt < 0)
+ buttons |= 1UL << 4;
+
sc->sc_status.button = buttons;
sc->sc_status.dx += dx;
sc->sc_status.dy += dy;
@@ -454,6 +460,12 @@
if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) {
info->sc_flags |= UMS_FLAG_T_AXIS;
}
+ } else if (hid_locate(buf, len, HID_USAGE2(HUP_CONSUMER,
+ HUC_AC_PAN), hid_input, index, &info->sc_loc_t,
+ &flags, &info->sc_iid_t)) {
+
+ if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS)
+ info->sc_flags |= UMS_FLAG_T_AXIS;
}
/* figure out the number of buttons */
==== //depot/projects/usb/src/sys/dev/usb/usbhid.h#12 (text+ko) ====
@@ -156,6 +156,9 @@
#define HUD_ERASER 0x0045
#define HUD_TABLET_PICK 0x0046
+/* Usages, Consumer */
+#define HUC_AC_PAN 0x0238
+
#define HID_USAGE2(p,u) (((p) << 16) | (u))
#define UHID_INPUT_REPORT 0x01
More information about the p4-projects
mailing list