From owner-freebsd-current@FreeBSD.ORG Fri Aug 13 14:36:21 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B3D616A4CE for ; Fri, 13 Aug 2004 14:36:21 +0000 (GMT) Received: from moya.lambermont.dyndns.org (e165253.upc-e.chello.nl [213.93.165.253]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80F3443D31 for ; Fri, 13 Aug 2004 14:36:20 +0000 (GMT) (envelope-from hans@lambermont.dyndns.org) Received: from localhost (localhost [127.0.0.1]) by moya.lambermont.dyndns.org (Postfix) with ESMTP id 0F7A43640A; Fri, 13 Aug 2004 16:36:19 +0200 (CEST) Received: from moya.lambermont.dyndns.org ([127.0.0.1])port 10024) with ESMTP id 74367-09; Fri, 13 Aug 2004 16:36:18 +0200 (CEST) Received: by moya.lambermont.dyndns.org (Postfix, from userid 1001) id AE7DC36409; Fri, 13 Aug 2004 16:36:18 +0200 (CEST) Date: Fri, 13 Aug 2004 16:36:18 +0200 To: Arne Schwabe Message-ID: <20040813143618.GA69012@moya.lambermont.dyndns.org> References: <20040813121959.GB98324@moya.lambermont.dyndns.org> <86llgjyyfx.fsf@kamino.rfc1149.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline In-Reply-To: <86llgjyyfx.fsf@kamino.rfc1149.org> User-Agent: Mutt/1.4.2.1i From: hans@lambermont.dyndns.org (Hans Lambermont) X-Virus-Scanned: by amavisd-new-20030616.p5 at lambermont.dyndns.org cc: freebsd-current@freebsd.org Subject: Re: laptop touchpad quirks X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Aug 2004 14:36:21 -0000 --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--