Subject: Apple Mighty Mouse
To: None <tech-kern@NetBSD.org>
From: Kouichirou Hiratsuka <hira@po6.nsk.ne.jp>
List: tech-kern
Date: 09/06/2005 01:20:20
Hello,

I bought the Apple Mighty Mouse.  It almost works fine.  However,
the scroll ball has a problem.  I can scroll the firefox vertically
by scrolling the scroll ball horizontally.

With this mouse, HUG_Z represents different data from HUG_WHEEL.
HUG_Z reports horizontal scroll and HUG_WHEEL reports vertical
scroll.  If HUG_Z is available, ums.c uses it and don't use
HUG_WHEEL.  It's wrong for this mouse.

This mouse works fine with the attached patch.  But it's wrong way
to fix.  How to fix this?
-- 
 Kouichirou Hiratsuka
   hira@po6.nsk.ne.jp

--- ums.c.orig	2005-09-06 00:57:07.000000000 +0900
+++ ums.c	2005-09-06 00:58:02.000000000 +0900
@@ -193,11 +193,9 @@
 
 	/* Try to guess the Z activator: first check Z, then WHEEL. */
 	wheel = 0;
-	if (hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Z),
-	       uha->reportid, hid_input, &sc->sc_loc_z, &flags) ||
-	    (wheel = hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP,
-						       HUG_WHEEL),
-	       uha->reportid, hid_input, &sc->sc_loc_z, &flags))) {
+	if (wheel = hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP,
+						      HUG_WHEEL),
+	       uha->reportid, hid_input, &sc->sc_loc_z, &flags)) {
 		if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
 			sc->sc_loc_z.size = 0;	/* Bad Z coord, ignore it */
 		} else {