PERFORCE change 166590 for review

Hans Petter Selasky hselasky at FreeBSD.org
Sun Jul 26 17:24:28 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166590

Change 166590 by hselasky at hselasky_laptop001 on 2009/07/26 17:24:17

	
	USB input:
	 - fix for spurious USB mouse button release when using multi-ID HID reports.
	 - reported by Kostik Belousov

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/input/ums.c#21 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/input/ums.c#21 (text+ko) ====

@@ -265,11 +265,17 @@
 			dt -= hid_get_data(buf, len, &info->sc_loc_t);
 
 		for (i = 0; i < info->sc_buttons; i++) {
-			if (id != info->sc_iid_btn[i])
+			uint32_t mask;
+			mask = 1UL << UMS_BUT(i);
+			/* check for correct button ID */
+			if (id != info->sc_iid_btn[i]) {
+				/* keep old button value */
+				buttons |= sc->sc_status.button & mask;
 				continue;
-			if (hid_get_data(buf, len, &info->sc_loc_btn[i])) {
-				buttons |= (1 << UMS_BUT(i));
 			}
+			/* check for button pressed */
+			if (hid_get_data(buf, len, &info->sc_loc_btn[i]))
+				buttons |= mask;
 		}
 
 		if (++info != &sc->sc_info[UMS_INFO_MAX])


More information about the p4-projects mailing list