From 5338f5dd69a59a1401b0fbdfeb0c90f4d3a80b54 Mon Sep 17 00:00:00 2001 From: Maksim Yevmenkin Date: Tue, 21 Mar 2006 18:42:52 +0000 Subject: [PATCH] Properly map mouse buttons PR: bin/94577 Submitted by: Krzysztof Jedruczyk < beaker at hot dot pl > MFC after: 3 days --- usr.sbin/bluetooth/bthidd/hid.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bluetooth/bthidd/hid.c b/usr.sbin/bluetooth/bthidd/hid.c index 0ae57bdfb76..c350110ba00 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;