svn commit: r308396 - stable/9/sys/dev/usb/input

Hans Petter Selasky hselasky at FreeBSD.org
Mon Nov 7 08:17:25 UTC 2016


Author: hselasky
Date: Mon Nov  7 08:17:23 2016
New Revision: 308396
URL: https://svnweb.freebsd.org/changeset/base/308396

Log:
  MFC r308144 and r308165:
  Fixes for virtual T-axis buttons.
  
  Make sure the virtual T-axis buttons gets cleared for USB mice which has
  less than 6 buttons.
  
  Make sure the virtual T-axis buttons generate button release event(s)
  for continuous tilting.
  
  PR:	213919
  PR:	213957

Modified:
  stable/9/sys/dev/usb/input/ums.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/usb/input/ums.c
==============================================================================
--- stable/9/sys/dev/usb/input/ums.c	Mon Nov  7 08:15:58 2016	(r308395)
+++ stable/9/sys/dev/usb/input/ums.c	Mon Nov  7 08:17:23 2016	(r308396)
@@ -258,8 +258,11 @@ ums_intr_callback(struct usb_xfer *xfer,
 		}
 
 		if ((info->sc_flags & UMS_FLAG_T_AXIS) &&
-		    (id == info->sc_iid_t))
+		    (id == info->sc_iid_t)) {
 			dt -= hid_get_data(buf, len, &info->sc_loc_t);
+			/* T-axis is translated into button presses */
+			buttons_found |= (1UL << 5) | (1UL << 6);
+		}
 
 		for (i = 0; i < info->sc_buttons; i++) {
 			uint32_t mask;
@@ -287,10 +290,13 @@ ums_intr_callback(struct usb_xfer *xfer,
 			    dx, dy, dz, dt, dw, buttons);
 
 			/* translate T-axis into button presses until further */
-			if (dt > 0)
+			if (dt > 0) {
+				ums_put_queue(sc, 0, 0, 0, 0, buttons);
 				buttons |= 1UL << 5;
-			else if (dt < 0)
+			} else if (dt < 0) {
+				ums_put_queue(sc, 0, 0, 0, 0, buttons);
 				buttons |= 1UL << 6;
+			}
 
 			sc->sc_status.button = buttons;
 			sc->sc_status.dx += dx;


More information about the svn-src-stable-9 mailing list