aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2016-11-07 08:18:51 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2016-11-07 08:18:51 +0000
commit1ba148867dbe9c2eaab8f0218a27be0e2715b0b8 (patch)
tree01c2a6f5620646074202b417e5a49851aa7d0f80
parent7dec109bc1dcd50dfc3e2609de978fec11a712db (diff)
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
Notes
Notes: svn path=/stable/8/; revision=308397
-rw-r--r--sys/dev/usb/input/ums.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c
index cdf30eb01a3e..3ac37a941122 100644
--- a/sys/dev/usb/input/ums.c
+++ b/sys/dev/usb/input/ums.c
@@ -258,8 +258,11 @@ ums_intr_callback(struct usb_xfer *xfer, usb_error_t error)
}
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, usb_error_t error)
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;