Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 May 2008 23:41:33 +0200
From:      Kai Wang <kaiwang27@gmail.com>
To:        Alexander Leidinger <Alexander@Leidinger.net>
Cc:        usb@freebsd.org
Subject:   Re: How to remap or ignore certain mouse buttons? (was: Fun with Logitech keyboard/mouse kombo (diNovo Edge)...)
Message-ID:  <20080508214133.GA1936@plan0>
In-Reply-To: <20080508151321.51af2488@deskjail>
References:  <20080507192420.694f57ee@deskjail> <20080508103636.153b1576@deskjail> <a92a9f4c0805080359l8e71684la7be565c1ba39d05@mail.gmail.com> <20080508151321.51af2488@deskjail>

next in thread | previous in thread | raw e-mail | index | archive | help
This mouse got two very similar usage collections, the difference
is one of them defined 4 more buttons.

Let's try to speicify the buttons, XY axis and wheel explicitly and
see what happens...

Could you please try following two patches? 
(assuming you are using latest CURRENT, and you need to substitute VENDORID
and PRODUCTID with the real id of your mouse)

First apply patch A:

--- ums.c.old	2008-05-08 23:21:06.000000000 +0200
+++ ums.c	2008-05-08 23:13:53.000000000 +0200
@@ -407,6 +407,19 @@
 		sc->sc_loc_btn[2].pos = 2;
 	}
 
+	if (uaa->vendor == VENDORID && uaa->product == PRODUCTID) {
+		sc->flags = UMS_Z;
+		sc->nbuttons = 3;
+		sc->sc_isize = 7;
+		sc->sc_iid = 5;
+		sc->sc_loc_x.pos = 8;
+		sc->sc_loc_y.pos = 20;
+		sc->sc_loc_z.pos = 32;
+		sc->sc_loc_btn[0].pos = 0;
+		sc->sc_loc_btn[1].pos = 1;
+		sc->sc_loc_btn[2].pos = 2;
+	}
+
 	sc->sc_ep_addr = ed->bEndpointAddress;
 	sc->sc_disconnected = 0;
 	free(desc, M_TEMP);


After test, revert patch A and apply patch B instead:

--- ums.c.old	2008-05-08 23:21:06.000000000 +0200
+++ ums.c	2008-05-08 23:21:54.000000000 +0200
@@ -407,6 +407,19 @@
 		sc->sc_loc_btn[2].pos = 2;
 	}
 
+	if (uaa->vendor == VENDORID && uaa->product == PRODUCTID) {
+		sc->flags = UMS_Z;
+		sc->nbuttons = 3;
+		sc->sc_isize = 7;
+		sc->sc_iid = 2;
+		sc->sc_loc_x.pos = 8;
+		sc->sc_loc_y.pos = 20;
+		sc->sc_loc_z.pos = 32;
+		sc->sc_loc_btn[0].pos = 0;
+		sc->sc_loc_btn[1].pos = 1;
+		sc->sc_loc_btn[2].pos = 2;
+	}
+
 	sc->sc_ep_addr = ed->bEndpointAddress;
 	sc->sc_disconnected = 0;
 	free(desc, M_TEMP);


(Only difference between these two patches is the value of sc->sc_iid)

What will moused output after applying these two patches, repectively?


Best Regards,
Kai



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