summaryrefslogtreecommitdiff
path: root/sys/isa
diff options
context:
space:
mode:
authorPhilip Paeps <philip@FreeBSD.org>2004-08-08 00:57:07 +0000
committerPhilip Paeps <philip@FreeBSD.org>2004-08-08 00:57:07 +0000
commit7589cb5cae8a0cebbf08e0499e6cc6035b2c93fa (patch)
treed977781c0592d5a0e12a1ac517daf5df8fa2221e /sys/isa
parent4079d722ac2380720256f4b94105564583aebe66 (diff)
Notes
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/psm.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/sys/isa/psm.c b/sys/isa/psm.c
index d81177748c8d..37faa1bfca18 100644
--- a/sys/isa/psm.c
+++ b/sys/isa/psm.c
@@ -2502,16 +2502,19 @@ psmsoftintr(void *arg)
((pb->ipacket[0] & 0x04) >> 1) |
((pb->ipacket[3] & 0x04) >> 2);
+ /* Button presses */
ms.button = 0;
if (pb->ipacket[0] & 0x01)
ms.button |= MOUSE_BUTTON1DOWN;
if (pb->ipacket[0] & 0x02)
ms.button |= MOUSE_BUTTON3DOWN;
- if ((pb->ipacket[3] & 0x01) && (pb->ipacket[0] & 0x01) == 0)
- ms.button |= MOUSE_BUTTON2DOWN;
- if ((pb->ipacket[3] & 0x02) && (pb->ipacket[0] & 0x02) == 0)
- ms.button |= MOUSE_BUTTON4DOWN;
+ if (sc->synhw.capExtended && sc->synhw.capFourButtons) {
+ if ((pb->ipacket[3] & 0x01) && (pb->ipacket[0] & 0x01) == 0)
+ ms.button |= MOUSE_BUTTON4DOWN;
+ if ((pb->ipacket[3] & 0x02) && (pb->ipacket[0] & 0x02) == 0)
+ ms.button |= MOUSE_BUTTON5DOWN;
+ }
/* There is a finger on the pad. */
if ((w >= 4 && w <= 7) && (z >= 16 && z < 200)) {
@@ -2537,7 +2540,15 @@ psmsoftintr(void *arg)
} else {
sc->flags &= ~PSM_FLAGS_FINGERDOWN;
}
- z = 0;
+
+ /* Use the extra buttons as a scrollwheel */
+ if (ms.button & MOUSE_BUTTON4DOWN)
+ z = -1;
+ else if (ms.button & MOUSE_BUTTON5DOWN)
+ z = 1;
+ else
+ z = 0;
+
break;
case MOUSE_MODEL_GENERIC:
@@ -3140,6 +3151,16 @@ enable_synaptics(struct psm_softc *sc)
/* Reset the sampling rate */
set_mouse_sampling_rate(kbdc, 20);
+ /*
+ * Report the correct number of buttons
+ *
+ * XXX: I'm not sure this is used anywhere.
+ */
+ if (sc->synhw.capExtended && sc->synhw.capFourButtons)
+ sc->hw.buttons = 4;
+ else
+ sc->hw.buttons = 3;
+
return (TRUE);
}