Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Oct 2016 18:38:50 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308144 - head/sys/dev/usb/input
Message-ID:  <201610311838.u9VIcoG6023627@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Oct 31 18:38:50 2016
New Revision: 308144
URL: https://svnweb.freebsd.org/changeset/base/308144

Log:
  Make sure the virtual T-axis buttons gets cleared for USB mice which has
  less than 6 buttons.
  
  PR:		213919
  MFC after:	3 days

Modified:
  head/sys/dev/usb/input/ums.c

Modified: head/sys/dev/usb/input/ums.c
==============================================================================
--- head/sys/dev/usb/input/ums.c	Mon Oct 31 18:37:44 2016	(r308143)
+++ head/sys/dev/usb/input/ums.c	Mon Oct 31 18:38:50 2016	(r308144)
@@ -295,8 +295,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;



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