| Summary: | Touchpad on NEC Versa laptop is unusable as mouse button. | ||
|---|---|---|---|
| Product: | Base System | Reporter: | david |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | david |
| Priority: | Normal | ||
| Version: | 4.2-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
Might as well cancel this PR: the hardware in question is old; I cannot tell if the symptoms I observed were because the hardware itself was flaky (I had no similar systems for coomparison), and I no longer have access to the hardware in question anyway. Cheers, david -- David H. Wolfskill david@catwhisker.org I believe it would be irresponsible (and thus, unethical) for me to advise, recommend, or support the use of any product that is or depends on any Microsoft product for any purpose other than personal amusement. State Changed From-To: open->closed Closed at submitters request as it relates to old, possibly twitchy hardware. |
The effect is that the "depressed/released" state of the "button" that corresponds to the touchpad (button 4) is reversed from what is actually going on in reality. This makes the "button 4" capability of the touchpad very difficult to use, especially if it's mapped (as I did) to "effective button 1" (via moused). Fix: Well, the above-referenced logic switch makes the NEC Versa work, but it breaks everything else, which is Really Bad. So I survived for a while by custom-hacking psm.c just for kernels for the NEC. But over the long holiday (Thanksgiving here in the US), I wanted to experiment with Ambrisko's Aironet encryption patches, so I upgraded 3 laptops to 4.2-S (with Doug's patches -- unrelated to the topic of the PR, but that's why I was doing it). And all went Really Well until I actually tried to use the NEC Versa -- I had forgotten about the psm.c hack. So I decided to do something moiderately constructive, and try to cobble up a patch that would actually fix the problem. I saw that there was a psm config flag bit left in the low-order 16 bits, so the patch I cobbled up has made use of it; I gave it the name "PSM_CONFOG_SYNCLOGICREV"; I also hacked up a patch for the psm (4) man page: =================================================================== RCS file: src/sys/isa/RCS/psm.c,v retrieving revision 1.1 Now I specify psm0 flags of 0x8900 (effectively 0xe900; 0x0600 is ORed in by psm.c during probing, and has been all along). And because of that 0x8000 flag, the logic-reversal is accomplished. The code is not at all pretty, and my feelings will not be hurt if the solution doesn't look like that at all; what I'm providing is something that seems to do the job for me, while not breaking other machines. (I note that it is still impossible to "triple click" the touchpad, though. That's not ideal, but it's far better than inability to use the touchpad as a mouse button at all.)--nhCE4nGgOTXSCIX7GI9DuUpbl3pPdKttYl8xFentjzJaG5rz Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" diff -u -r1.1 src/sys/isa/psm.c --- src/sys/isa/psm.c 2000/11/23 14:00:15 1.1 +++ src/sys/isa/psm.c 2000/11/23 21:50:21 @@ -178,6 +178,7 @@ #define PSM_CONFIG_IGNPORTERROR 0x1000 /* ignore error in aux port test */ #define PSM_CONFIG_HOOKRESUME 0x2000 /* hook the system resume event */ #define PSM_CONFIG_INITAFTERSUSPEND 0x4000 /* init the device at the resume event */ +#define PSM_CONFIG_SYNCLOGICREV 0x8000 /* logic reversal for sync bit */ #define PSM_CONFIG_FLAGS (PSM_CONFIG_RESOLUTION \ | PSM_CONFIG_ACCEL \ @@ -187,7 +188,8 @@ | PSM_CONFIG_FORCETAP \ | PSM_CONFIG_IGNPORTERROR \ | PSM_CONFIG_HOOKRESUME \ - | PSM_CONFIG_INITAFTERSUSPEND) + | PSM_CONFIG_INITAFTERSUSPEND \ + | PSM_CONFIG_SYNCLOGICREV) /* other flags (flags) */ #define PSM_FLAGS_FINGERDOWN 0x0001 /* VersaPad finger down */ @@ -1920,7 +1922,7 @@ ms.button = butmap[c & MOUSE_PS2_BUTTONS]; /* `tapping' action */ if (sc->config & PSM_CONFIG_FORCETAP) - ms.button |= ((c & MOUSE_PS2_TAP)) ? 0 : MOUSE_BUTTON4DOWN; + ms.button |= ((c & MOUSE_PS2_TAP) ^ ((sc->config & PSM_CONFIG_SYNCLOGICREV) ? MOUSE_PS2_TAP : 0)) ? 0 : MOUSE_BUTTON4DOWN; switch (sc->hw.model) { @@ -2052,7 +2054,7 @@ case MOUSE_MODEL_GLIDEPOINT: /* `tapping' action */ - ms.button |= ((c & MOUSE_PS2_TAP)) ? 0 : MOUSE_BUTTON4DOWN; + ms.button |= ((c & MOUSE_PS2_TAP) ^ ((sc->config & PSM_CONFIG_SYNCLOGICREV) ? MOUSE_PS2_TAP : 0)) ? 0 : MOUSE_BUTTON4DOWN; break; case MOUSE_MODEL_NETSCROLL: =================================================================== RCS file: src/share/man/man4/RCS/psm.4,v retrieving revision 1.1 diff -u -r1.1 src/share/man/man4/psm.4 --- src/share/man/man4/psm.4 2000/11/24 17:11:55 1.1 +++ src/share/man/man4/psm.4 2000/11/24 17:18:30 @@ -336,6 +336,13 @@ It has no effect unless the .Em HOOKRESUME flag is set as well. +.It bit 15 SYNCLOGICREV +This flag causes a ``logic reversal'' in the code that handles +the SYNC bit. It appears to be useful for a variant of the +ALPS GlidePoint that is used on the NEC Versa series of laptops. +A symptom that this flag would be appropriate is if the ``normal state'' +of the first mouse button is ``pressed,'' and changing the state to +act ``released'' requires that you press the button. .El .Sh IOCTLS There are a few =================================================================== How-To-Repeat: * Get an NEC Versa. (It may be specific to the 6030X model, though I would find that surprising.) * Install FreeBSD on it -- anything from the 3.x series up through 4.2-S will exhibit the problem. (I had mentioned the problem earlier, but the circumvention I had used was truly gross -- a couple of hard-coded logic-reversals in psm.c.) * Run moused with the above flags. * Run XF86Setup, and try to get (effective) mouse button 1 to do anything sane. You will find that with nothing touching the pad, buttons, or keyboard, button 1 will be seen as "depressed", and if you tap the touchpad, the button will be released... momentarily.