Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jul 2009 17:24:26 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 166590 for review
Message-ID:  <200907261724.n6QHOQmo025532@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

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

Change 166590 by hselasky@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])



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