summaryrefslogtreecommitdiff
path: root/sys/dev/adb/ams.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/adb/ams.c')
-rw-r--r--sys/dev/adb/ams.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/dev/adb/ams.c b/sys/dev/adb/ams.c
index 97edff1b7a5..114f5cebe98 100644
--- a/sys/dev/adb/ams.c
+++ b/sys/dev/adb/ams.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ams.c,v 1.1 2006/01/18 23:21:17 miod Exp $ */
+/* $OpenBSD: ams.c,v 1.2 2006/02/03 21:51:50 matthieu Exp $ */
/* $NetBSD: ams.c,v 1.11 2000/12/19 03:13:40 tsubai Exp $ */
/*
@@ -488,16 +488,17 @@ ms_processevent(adb_event_t *event, struct ams_softc *sc)
else
buttons &= ~button_bit;
/* Extended Protocol (up to 6 more buttons) */
- for (mask = 0x80; i < max_byte;
- i += (mask == 0x80), button_bit <<= 1) {
- /* 0 when button down */
- if (!(event->bytes[i] & mask))
- buttons |= button_bit;
- else
- buttons &= ~button_bit;
- mask = ((mask >> 4) & 0xf)
- | ((mask & 0xf) << 4);
- }
+ if (sc->sc_class == MSCLASS_MOUSE)
+ for (mask = 0x80; i < max_byte;
+ i += (mask == 0x80), button_bit <<= 1) {
+ /* 0 when button down */
+ if (!(event->bytes[i] & mask))
+ buttons |= button_bit;
+ else
+ buttons &= ~button_bit;
+ mask = ((mask >> 4) & 0xf)
+ | ((mask & 0xf) << 4);
+ }
break;
}
new_event.u.m.buttons = sc->sc_mb | buttons;