Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Aug 2004 16:36:18 +0200
From:      hans@lambermont.dyndns.org (Hans Lambermont)
To:        Arne Schwabe <arne@rfc2549.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: laptop touchpad quirks
Message-ID:  <20040813143618.GA69012@moya.lambermont.dyndns.org>
In-Reply-To: <86llgjyyfx.fsf@kamino.rfc1149.org>
References:  <20040813121959.GB98324@moya.lambermont.dyndns.org> <86llgjyyfx.fsf@kamino.rfc1149.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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.

--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="psm.hans.diff"

--- 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)) {

--xHFwDpU9dbj6ez1V--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040813143618.GA69012>