Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Mar 2007 01:57:35 +0000
From:      Rui Paulo <rpaulo@fnop.net>
To:        freebsd-current@freebsd.org
Subject:   Apple's Mighty Mouse (patch)
Message-ID:  <45F8A80F.10407@fnop.net>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------070708030408060809090309
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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

--------------070708030408060809090309
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
	name="mightymouse.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="mightymouse.diff"

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

--------------070708030408060809090309--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45F8A80F.10407>