summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bluetooth
diff options
context:
space:
mode:
authoremax <emax@FreeBSD.org>2006-03-21 18:42:52 +0000
committeremax <emax@FreeBSD.org>2006-03-21 18:42:52 +0000
commit270ddd37db67bd926281ae9910fb217ff919af55 (patch)
tree17f21a54cb3b92284fe7b96d3392cb32843af36f /usr.sbin/bluetooth
parent98c9faf4d0b9b91631aaec23337b0c0d9ad823a4 (diff)
downloadFreeBSD-src-270ddd37db67bd926281ae9910fb217ff919af55.zip
FreeBSD-src-270ddd37db67bd926281ae9910fb217ff919af55.tar.gz
Properly map mouse buttons
PR: bin/94577 Submitted by: Krzysztof Jedruczyk < beaker at hot dot pl > MFC after: 3 days
Diffstat (limited to 'usr.sbin/bluetooth')
-rw-r--r--usr.sbin/bluetooth/bthidd/hid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/bluetooth/bthidd/hid.c b/usr.sbin/bluetooth/bthidd/hid.c
index 0ae57bd..c350110 100644
--- a/usr.sbin/bluetooth/bthidd/hid.c
+++ b/usr.sbin/bluetooth/bthidd/hid.c
@@ -52,6 +52,9 @@
#undef ASIZE
#define ASIZE(a) (sizeof(a)/sizeof(a[0]))
+#undef HID_BUT
+#define HID_BUT(i) ((i) < 3 ? (((i) ^ 3) % 3) : (i))
+
/*
* Process data from control channel
*/
@@ -216,7 +219,7 @@ hid_interrupt(bthid_session_p s, char *data, int len)
break;
case HUP_BUTTON:
- mouse_butt |= (val << (usage - 1));
+ mouse_butt |= (val << HID_BUT(usage - 1));
mevents ++;
break;
OpenPOWER on IntegriCloud