From owner-freebsd-usb@FreeBSD.ORG Mon Aug 13 20:30:15 2012 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8820106564A for ; Mon, 13 Aug 2012 20:30:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C3CAA8FC0A for ; Mon, 13 Aug 2012 20:30:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7DKUFaO087729 for ; Mon, 13 Aug 2012 20:30:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7DKUFx6087726; Mon, 13 Aug 2012 20:30:15 GMT (envelope-from gnats) Date: Mon, 13 Aug 2012 20:30:15 GMT Message-Id: <201208132030.q7DKUFx6087726@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Tomasz Olejniczak Cc: Subject: Re: usb/170358: [ums] Wrong (duplicate) button numbers X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Tomasz Olejniczak List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2012 20:30:16 -0000 The following reply was made to PR usb/170358; it has been noted by GNATS. From: Tomasz Olejniczak 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