From owner-freebsd-current@FreeBSD.ORG Thu Mar 15 01:57:42 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B4E416A407 for ; Thu, 15 Mar 2007 01:57:42 +0000 (UTC) (envelope-from rpaulo@fnop.net) Received: from core.fnop.net (mx.fnop.net [82.102.11.82]) by mx1.freebsd.org (Postfix) with ESMTP id 86BB213C457 for ; Thu, 15 Mar 2007 01:57:41 +0000 (UTC) (envelope-from rpaulo@fnop.net) Received: from core.fnop.net (mx.fnop.net [82.102.11.82]) by core.fnop.net (Postfix) with ESMTP id 4957069060B for ; Thu, 15 Mar 2007 01:58:27 +0000 (WET) Received: by core.fnop.net (Postfix, from userid 1015) id 0A7D369062E; Thu, 15 Mar 2007 01:58:27 +0000 (WET) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on core.fnop.net X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,RCVD_IN_SORBS_DUL,UPPERCASE_25_50 autolearn=no version=3.1.7 Received: from epsilon.local (87-196-26-81.net.novis.pt [87.196.26.81]) by core.fnop.net (Postfix) with ESMTP id 93E8669060B for ; Thu, 15 Mar 2007 01:58:23 +0000 (WET) Message-ID: <45F8A80F.10407@fnop.net> Date: Thu, 15 Mar 2007 01:57:35 +0000 From: Rui Paulo User-Agent: Thunderbird 2.0b2 (Macintosh/20070116) MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: multipart/mixed; boundary="------------070708030408060809090309" X-Virus-Scanned: ClamAV using ClamSMTP Subject: Apple's Mighty Mouse (patch) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2007 01:57:42 -0000 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--