MS USB Wireless Mouse

2005-06-13 Thread Michal Vanco

Hi,

my problem with %subj% continues. Recently I have forced ums to detect 
it as mouse but there are still some weird things.


ums0: Microsoft Microsoft USB Wireless Mouse, rev 2.00/0.17, addr 2, 
iclass 3/1
ums_attach: bLength=7 bDescriptorType=5 bEndpointAddress=1-in 
bmAttributes=3 wMaxPacketSize=8 bInterval=10

ums0: 5 buttons and Z dir.
ums_attach: sc=0xc1bcb800
ums_attach: X   48/8
ums_attach: Y   56/8
ums_attach: Z   64/8
ums_attach: B1  40/1
ums_attach: B2  41/1
ums_attach: B3  42/1
ums_attach: B4  43/1
ums_attach: B5  44/1
ums_attach: size=11, id=19

... seems like reported locations X,Y,Z and buttons are wrong.

any clues?
thanx
michal

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: MS USB Wireless Mouse

2005-06-13 Thread Michal Vanco

Michal Vanco wrote:


... seems like reported locations X,Y,Z and buttons are wrong.


well ... this works. but i'm not sure for other mices

diff -Nrua usb/ums.c /sys/dev/usb/ums.c
--- usb/ums.c   Sun Jan 30 02:00:10 2005
+++ /sys/dev/usb/ums.c  Mon Jun 13 16:24:50 2005
@@ -76,6 +76,7 @@
#include machine/mouse.h
#endif

+
#ifdef USB_DEBUG
#define DPRINTF(x) if (umsdebug) logprintf x
#define DPRINTFN(n,x)  if (umsdebug(n)) logprintf x
@@ -287,6 +288,9 @@
   if (hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, 
HUG_TWHEEL),

   hid_input, sc-sc_loc_t, flags)) {
   sc-sc_loc_t.pos = sc-sc_loc_t.pos + 8;
+   sc-sc_loc_x.pos = sc-sc_loc_x.pos - 40;
+   sc-sc_loc_y.pos = sc-sc_loc_y.pos - 40;
+   sc-sc_loc_z.pos = sc-sc_loc_z.pos - 40;
   sc-flags |= UMS_T;
   }

@@ -307,9 +311,12 @@
  sc-nbuttons, sc-flags  UMS_Z?  and Z dir : ,
  sc-flags  UMS_T? and a TILT dir: );

-   for (i = 1; i = sc-nbuttons; i++)
+   for (i = 1; i = sc-nbuttons; i++) {
   hid_locate(desc, size, HID_USAGE2(HUP_BUTTON, i),
   hid_input, sc-sc_loc_btn[i-1], 0);
+   if (sc-flags  UMS_T)
+ sc-sc_loc_btn[i - 1].pos -= 40;
+   }

   sc-sc_isize = hid_report_size(desc, size, hid_input, sc-sc_iid);
   sc-sc_ibuf = malloc(sc-sc_isize, M_USB, M_NOWAIT);
@@ -458,8 +465,9 @@
*/
   if (sc-flags  UMS_T) {
   if (sc-sc_iid) {
-   if (*ibuf++ == 0x02)
-   return;
+ ibuf++;
+ if (*(ibuf - 1) == 0x02 || *(ibuf - 1) == 0x14)
+ return;
   }
   } else {
   if (sc-sc_iid) {

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]