Subject: Re: Phantom button presses from trackpad
To: David H. Gutteridge <dhgutteridge@sympatico.ca>
From: Michael Lorenz <macallan@netbsd.org>
List: port-macppc
Date: 10/22/2006 21:56:42
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Oct 22, 2006, at 19:09, David H. Gutteridge wrote:

>> Good, the point of the change was to make tapping the pad work as 
>> button
>> one.
>> About the phantom buttons - all Apple trackpads I know report more 
>> than one
>> button ( two in the PB3400c, four in my iBook G4 ) - the only one 
>> that's
>> corresponding to a real life button is button one. The others are 
>> (ab)used
>> for stuff like signalling that there's a finger on the pad ( the 
>> two-button
>> version uses button 2-4 for that, the four-button version uses button 
>> 5 and
>> reports button four as always down).
>> The button count reported is bogus and ought to be read as protocol
>> revision or something.
>
> I've also experienced the button 179 problem on my trusty old clamshell
> iBook SE, running 3.0.1 at present.  I grabbed v. 1.20 of ams.c and 1.5
> of amsvar.h and applied them against the 3.0 branch.  (I just had to
> change ams_ioctl() back to use the proc rather than lwp struct, as
> altered in v. 1.18 of ams.c.)  I assume that was safe; it worked for 
> me.

The code hasn't been touched for ages, it would probably work with 2.0 
or even 1.6.

> After the change, the trackpad is now completely usable.  One thing
> though -- not that it bothers me -- Michael, you've noted the intent
> was to make tapping the pad work as button one.  That doesn't happen
> for me.

So your pad appears to use yet another different protocol.

> As above, before the change if I used the trackpad with xev(1)
> it would report button 179 as soon as I touched it.

Would it report /another/ button when you take the finger from the pad? 
Or would it just report a button-up event for 179?

> Now it never reports any button events when I touch it, whether that's 
> a tap or
> something more prolonged.  Like I said, no worries for me, I don't use
> the trackpad to click (in fact, I had no idea one could do that), but
> thought I'd mention it.  (Perhaps it's something to do with the older
> branch I'm using?)

As far as I can tell your pad just uses another variant of the 
protocol. Now we need to figure out how to recognize this revision and 
which phantom buttons it uses how.

Would it be ok if I just send you a patch that reports button events on 
the ADB level and you tell me what kind of events you get when putting 
a finger on the pad, move it, lift it up again?

>> So, has anyone ever seen an ADB trackpad that reports something else 
>> than
>> two or four buttons?
>
> My iBook reports two buttons.

It's listed ad EMP trackpad in dmesg, isn't it?

have fun
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iQEVAwUBRTwhWspnzkX8Yg2nAQJm0wf+P9unZjYbgYt6RyFvil+MUd1YCQCDkTRJ
kjSgqirjg8VSgH+HucfIbIC/Lvf5eupWlHR/l2ENbP1EQ0Aml61RVTk53Pwesc3H
+09Wa6o3dTyPC5RQtwFRMGI5gfUUE3rWc6koCoSr1qvn1A+VSFmhOOc3AiTQF3Hq
e/Hz5URkdJm+LHoN1SSxuKy9EF5C3Y6lcA8dLRz9hRQPtYAiyq9uKjMTr3GHQvxm
4FcEoliHNCXgjq/hiDXS6O2l062NwhxxqrzZOu9BfCWe2lfoj8yQcD2JheyeSBwF
Kr6yhEjFypKRVHBM5oSokKigdgPJ3kULZB7NnFRKc3ksEJaGGhEjxA==
=MAQJ
-----END PGP SIGNATURE-----