laptop touchpad quirks
Hans Lambermont
hans at lambermont.dyndns.org
Fri Aug 13 07:36:21 PDT 2004
Arne Schwabe wrote:
> Hans Lambermont writes:
>> My laptop's touchpad top buttons and the mouse-tip in the keyboard no
>> longer work. This is on 5.2-CURRENT #0: Fri Aug 13 13:24:19 CEST 2004.
>> The laptop is an IBM T30, the touchpad has 3 buttons on top which no
>> longer work, and 2 on the bottom, which still work as before.
>
> I bet your stick does not work either,
Correct, I tried to say that, but I guess 'mouse-tip' is not what it is
called.
> you could my patch for the guest device. Please report if it works.
> http://www.plaisthos.de/freebsd/psm.philip.diff
Patching file psm.c using Plan A...
Hunk #1 failed at 2176.
Hunk #2 failed at 2514.
I'm using psm.c 1.76 2004/08/08 01:26:00 philip, cvsupped this morning.
I patched manually, and it works great :)
I attached the modified diff.
Thanks for your work.
regards,
Hans
--
http://lambermont.webhop.org/ () ASCII-ribbon campaign against vCards,
/\ HTML-mail and proprietary formats.
-------------- next part --------------
--- psm.c.org Fri Aug 13 15:42:10 2004
+++ psm.c Fri Aug 13 16:02:33 2004
@@ -2176,6 +2176,8 @@
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,19 +2521,44 @@
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)) {
More information about the freebsd-current
mailing list