diff options
author | philip <philip@FreeBSD.org> | 2004-08-16 16:28:27 +0000 |
---|---|---|
committer | philip <philip@FreeBSD.org> | 2004-08-16 16:28:27 +0000 |
commit | afd3ab767669f54bb08a5ea27f1025423b9b1476 (patch) | |
tree | e38a8e05433d8516f19d7b540b86a76623e24b1b /sys/dev/atkbdc | |
parent | d877ffb047b709512a84ee01551a463c565ed1b4 (diff) | |
download | FreeBSD-src-afd3ab767669f54bb08a5ea27f1025423b9b1476.zip FreeBSD-src-afd3ab767669f54bb08a5ea27f1025423b9b1476.tar.gz |
Update support for Synaptics Touchpads (Volume V)
o Add (long awaited) support for guest devices
Submitted by: Arne Schwabe <arne@rfc2549.org>
Approved by: njl (in a former revision)
Diffstat (limited to 'sys/dev/atkbdc')
-rw-r--r-- | sys/dev/atkbdc/psm.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 415cf74..ce609a7 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -2176,6 +2176,8 @@ psmsoftintr(void *arg) MOUSE_BUTTON1DOWN, MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN }; + static int touchpad_buttons = 0; + static int guest_buttons = 0; register struct psm_softc *sc = arg; mousestatus_t ms; int w, x, y, z; @@ -2519,20 +2521,42 @@ psmsoftintr(void *arg) w = 4; } + /* Handle packets from the guest device */ + if (w == 3 && sc->synhw.capPassthrough) { + x = ((pb->ipacket[1] & 0x10) ? + pb->ipacket[4] - 256 : pb->ipacket[4]); + y = ((pb->ipacket[1] & 0x20) ? + pb->ipacket[5] - 256 : pb->ipacket[5]); + z = 0; + + guest_buttons = 0; + if (pb->ipacket[1] & 0x01) + guest_buttons |= MOUSE_BUTTON1DOWN; + if (pb->ipacket[1] & 0x04) + guest_buttons |= MOUSE_BUTTON2DOWN; + if (pb->ipacket[1] & 0x02) + guest_buttons |= MOUSE_BUTTON3DOWN; + + ms.button = touchpad_buttons | guest_buttons; + break; + } + /* Button presses */ - ms.button = 0; + touchpad_buttons = 0; if (pb->ipacket[0] & 0x01) - ms.button |= MOUSE_BUTTON1DOWN; + touchpad_buttons |= MOUSE_BUTTON1DOWN; if (pb->ipacket[0] & 0x02) - ms.button |= MOUSE_BUTTON3DOWN; + touchpad_buttons |= MOUSE_BUTTON3DOWN; if (sc->synhw.capExtended && sc->synhw.capFourButtons) { if ((pb->ipacket[3] & 0x01) && (pb->ipacket[0] & 0x01) == 0) - ms.button |= MOUSE_BUTTON4DOWN; + touchpad_buttons |= MOUSE_BUTTON4DOWN; if ((pb->ipacket[3] & 0x02) && (pb->ipacket[0] & 0x02) == 0) - ms.button |= MOUSE_BUTTON5DOWN; + touchpad_buttons |= MOUSE_BUTTON5DOWN; } + ms.button = touchpad_buttons | guest_buttons; + /* There is a finger on the pad. */ if ((w >= 4 && w <= 7) && (z >= 16 && z < 200)) { x0 = ((pb->ipacket[3] & 0x10) << 8) | |