ums(4) and Apple Mighty Mouse

"José M. Fandiño" freebsd4 at fadesa.es
Thu Aug 17 17:16:03 UTC 2006


 >José M. Fandiño wrote:
>> Now is when the problem comes, the Z axis is mapped to
>> the horizontal scrolling, which is very confusing because
>> to scroll a web page you need move horizontally the
>> trackball.


I've found a possible solution but I don't know if
this might break something.


--- sys/dev/usb/ums.c.original  Thu Aug 17 19:06:33 2006
+++ sys/dev/usb/ums.c   Thu Aug 17 19:06:55 2006
@@ -267,9 +267,9 @@
         }

         /* try to guess the Z activator: first check Z, then WHEEL */
-       if (hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Z),
+       if (hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
                        hid_input, &sc->sc_loc_z, &flags) ||
-           hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
+           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_TWHEEL),
                        hid_input, &sc->sc_loc_z, &flags)) {


now the Z axis is located at 32/8 with the mighty mouse and
at 24/8 with a standard mouse.


Aug 17 19:07:54 info kernel: ums0: Mitsumi Electric Apple Optical USB Mouse, rev 1.10/1.08, addr 2, iclass 3/1
Aug 17 19:07:54 info kernel: ums_attach: bLength=7 bDescriptorType=5 bEndpointAddress=1-in bmAttributes=3 wMaxPacketSize=6 bInterval=10
Aug 17 19:07:54 info kernel: ums0: 4 buttons and Z dir.
Aug 17 19:07:54 info kernel: ums_attach: sc=0xc27ae000
Aug 17 19:07:54 info kernel: ums_attach: X    8/8
Aug 17 19:07:54 info kernel: ums_attach: Y    16/8
Aug 17 19:07:54 info kernel: ums_attach3: Z   32/8
Aug 17 19:07:54 info kernel: ums_attach: B1   0/1
Aug 17 19:07:54 info kernel: ums_attach: B2   1/1
Aug 17 19:07:54 info kernel: ums_attach: B3   2/1
Aug 17 19:07:54 info kernel: ums_attach: B4   3/1
Aug 17 19:07:54 info kernel: ums_attach: size=6, id=0

Aug 17 19:08:08 info kernel: ums0: Logitech USB-PS/2 Optical Mouse, rev 2.00/20.00, addr 2, iclass 3/1
Aug 17 19:08:08 info kernel: ums_attach: bLength=7 bDescriptorType=5 bEndpointAddress=1-in bmAttributes=3 wMaxPacketSize=4 bInterval=10
Aug 17 19:08:08 info kernel: ums0: 3 buttons and Z dir.
Aug 17 19:08:08 info kernel: ums_attach: sc=0xc26a0000
Aug 17 19:08:08 info kernel: ums_attach: X    8/8
Aug 17 19:08:08 info kernel: ums_attach: Y    16/8
Aug 17 19:08:08 info kernel: ums_attach3: Z   24/8
Aug 17 19:08:08 info kernel: ums_attach: B1   0/1
Aug 17 19:08:08 info kernel: ums_attach: B2   1/1
Aug 17 19:08:08 info kernel: ums_attach: B3   2/1
Aug 17 19:08:08 info kernel: ums_attach: size=4, id=0






More information about the freebsd-usb mailing list