How to remap or ignore certain mouse buttons? (was: Fun with Logitech keyboard/mouse kombo (diNovo Edge)...)

Kai Wang kaiwang27 at gmail.com
Thu May 8 22:08:50 UTC 2008


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


More information about the freebsd-usb mailing list