Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2012 20:30:15 GMT
From:      Tomasz Olejniczak <tomek.apostata@gmail.com>
To:        freebsd-usb@FreeBSD.org
Subject:   Re: usb/170358: [ums] Wrong (duplicate) button numbers
Message-ID:  <201208132030.q7DKUFx6087726@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR usb/170358; it has been noted by GNATS.

From: Tomasz Olejniczak <tomek.apostata@gmail.com>
To: bug-followup@FreeBSD.org, tomek.apostata@gmail.com
Cc:  
Subject: Re: usb/170358: [ums] Wrong (duplicate) button numbers
Date: Mon, 13 Aug 2012 22:22:48 +0200

 Hi,
 
 It seams that I found the problem and partial solution:
 I checked what is really coming out of the hid device  and found that
 "tilt wheel" is properly reported as horizontal scroll (on 8th byte).
 But in ums.c:
 
   289                         if (dt > 0)
   290                                 buttons |= 1UL << 3;
   291                         else if (dt < 0)
   292                                 buttons |= 1UL << 4;
   293
   294                         sc->sc_status.button = buttons;
   295                         sc->sc_status.dx += dx;
   296                         sc->sc_status.dy += dy;
   297                         sc->sc_status.dz += dz;
   298                         /*
   299                          * sc->sc_status.dt += dt;
   300                          * no way to export this yet
   301                          */
 
 As You see the sc_status is mousestatus_t which does not have dt... so
 driver assigns fixed numbers to buttons - the problem is that these
 buttons do exists - so we have 2 sets of buttons with the same
 numbers.
 
 For me the fix is simple - just assign different, free numbers:
 
   290                                 buttons |= 1UL << 5;
   291                         else if (dt < 0)
   292                                 buttons |= 1UL << 6;
 
 I know that this is not a real fix - other devices can also have these
 numbers "taken" - real fix should implement horizontal scroll in
 sys/sys/mouse.h, but for now it works for me.
 
 -- 
 Tomek



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