From owner-freebsd-mobile Fri Mar 10 22:48:47 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from pau-amma.whistle.com (pau-amma.whistle.com [207.76.205.64]) by hub.freebsd.org (Postfix) with ESMTP id 1C08037B653 for ; Fri, 10 Mar 2000 22:48:35 -0800 (PST) (envelope-from dhw@whistle.com) Received: (from dhw@localhost) by pau-amma.whistle.com (8.9.2/8.9.3) id WAA46423 for freebsd-mobile@freebsd.org; Fri, 10 Mar 2000 22:48:34 -0800 (PST) (envelope-from dhw) Date: Fri, 10 Mar 2000 22:48:34 -0800 (PST) From: David Wolfskill Message-Id: <200003110648.WAA46423@pau-amma.whistle.com> To: freebsd-mobile@freebsd.org Subject: Re: Touchpad (on NEC Versa 6030X), FreeBSD 4.0-RC (20000307), & XF86 3.3.6 In-Reply-To: <200003110014.QAA45467@pau-amma.whistle.com> Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Date: Fri, 10 Mar 2000 16:14:00 -0800 (PST) >From: David Wolfskill >The problem, however, is that -- according to XF86Setup -- button 1 is >normally depressed; tapping the touchpad releases it briefly. (That is, >in XF86Setup's "mouse diagram", the left mouse button stays black unless >I tap the touchpad, in whcih case it goes white... briefly.) >This, of course, is a simple logic reversal of my understanding of the >desired behavior. (The other buttons do seem to behave rationally.) Well, I started poking around, and I'm getting confused. Perhaps this is better for -hackers (or a therapist). In src/sys/isa/psm.c, around lines 54966-54968, I see: /* `tapping' action */ if (sc->config & PSM_CONFIG_FORCETAP) ms.button |= ((c & MOUSE_PS2_TAP)) ? 0 : MOUSE_BUTTON4DOWN; (There is similar code for the case of the GlidePoint mouse, though it's conditional only on the mouse being of the GlidePoint type, not on the PSM_CONFIG_FORCETAP flag having been specified.) And this confuses me because in the case in question, it appears to generate reults that are reveresed from what I would naively expect... so I think I'm missing something. At that point in the code, c was assigned to the first byte of the response from the mouse, which is: 0x01 for button 1 0x02 for button 2 0x04 for button 3 0x08 for button 4 The constant MOUSE_PS2_TAP is "8" (from /usr/include/machine/mouse.h). I tried enabling some debugging statements so I could see what is happening: if I tap on the touchscreen, "c"" gets a value of 8, so the "(c & MOUSE_PS2_TAP)" conditional is true, thus causing ms.button to be unchanged (|= 0). If some other buttonn is pressed, but I do not tap on the touchscreen, "c" gets "8" (the value of the MOUSE_BUTTON4DOWN constant) ORed in. I even went so far as to re-compile the kernel with the 2nd & 3rd operands of the ?:operator reversed... and XF86Setup seemed much happier with the results.... until I tried to start up the X server (which never happened; it just hung). So since I'm using moused, I thought that perhaps I could see about doing the reversal there. I started by killing off moused, then starting it again: sudo kill `cat /var/run/moused.pid ` && \ sudo moused -m 1=4 -m 2=1 -p /dev/psm0 -t auto -f -d Then for the left-hand mouse, it shows... well, rather more than I want to include. But the critical part is: moused: : 0 0 moused: button 1 count 1 moused: : 0 0 moused: button 2 count 1 (That's from depressing it.) and moused: button 2 count 0 (from releasing it). The same trick with the right-hand button is similar: moused: : 0 0 moused: button 3 count 1 and moused: button 3 count 0 But for the touchpad, I see: moused: button 1 count 0 moused: button 1 count 2 moused: button 1 count 3 ... and the "count" for that button keeps increasing. Curiouser and curiouser, david -- David Wolfskill dhw@whistle.com UNIX System Administrator voice: (650) 577-7158 pager: (888) 347-0197 FAX: (650) 372-5915 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message