Apple's Mighty Mouse (patch)
Rui Paulo
rpaulo at fnop.net
Thu Mar 15 01:57:42 UTC 2007
Hi,
The attached patch makes the wheel work correctly with in Apple's Mighty
Mouse.
Any comments?
--
Rui Paulo | PGP: F0E4 C7C7 1653 79B7 78DC DD73 64FA B2C6 CF45 1F84
-------------- next part --------------
Index: ums.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/ums.c,v
retrieving revision 1.83
diff -u -r1.83 ums.c
--- ums.c 17 Jan 2007 03:50:45 -0000 1.83
+++ ums.c 15 Mar 2007 01:51:29 -0000
@@ -266,8 +266,16 @@
USB_ATTACH_ERROR_RETURN;
}
+ /* Apple's Mighty Mouse reports HUG_Z as horizontal scrolling and
+ HUG_WHEEL as vertical scrolling. */
+ if (uaa->vendor == USB_VENDOR_APPLE &&
+ uaa->product == USB_PRODUCT_APPLE_OPTICALM) {
+ hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP,
+ HUG_WHEEL), hid_input, &sc->sc_loc_z, &flags);
+ printf("mighty mouse\n");
+ }
/* try to guess the Z activator: first check Z, then WHEEL */
- if (hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Z),
+ else if (hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Z),
hid_input, &sc->sc_loc_z, &flags) ||
hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
hid_input, &sc->sc_loc_z, &flags) ||
Index: usbdevs
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/usbdevs,v
retrieving revision 1.288
diff -u -r1.288 usbdevs
--- usbdevs 27 Feb 2007 22:27:53 -0000 1.288
+++ usbdevs 15 Mar 2007 01:51:30 -0000
@@ -688,6 +688,7 @@
product APPLE IPOD_08 0x1208 iPod '08'
product APPLE IPODVIDEO 0x1209 iPod Video
product APPLE IPODNANO 0x120a iPod Nano
+product APPLE OPTICALM 0x0304 Apple Optical USB Mouse
/* Arkmicro Technologies */
product ARKMICRO ARK3116 0x0232 ARK3116 Serial
More information about the freebsd-current
mailing list