From 9fd92977235fee544b56b1304f55e6277dafb6d7 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Sat, 25 Apr 2009 16:09:12 +0400 Subject: [PATCH] PS/2 interface: sense multifinger taps on FingerHigh Previously multifinger taps were sensed on the Z value > 0: this isn't very correct. Accorging to the specification, Z values below 30 correspond only to a very light taps or just floating fingers. I had run into the situation when I was clicking on the physical left button and that click was transformed to the right button click via ClickFinger2, but I wasn't tapping the touchpad at all. Investigations showed very small values of Z -- my other fingers were just floating above touchpad. This change also makes click (and finger) detection more consistent, because it uses FingerHigh to detect taps everywhere. Signed-off-by: Eygene Ryabinkin --- src/ps2comm.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/ps2comm.c b/src/ps2comm.c index 6c62918..47d656e 100644 --- a/src/ps2comm.c +++ b/src/ps2comm.c @@ -40,6 +40,7 @@ #include "ps2comm.h" #include "synproto.h" #include "synaptics.h" +#include "synapticsstr.h" #include #define MAX_UNSYNC_PACKETS 10 /* i.e. 10 to 60 bytes */ @@ -611,6 +612,8 @@ PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw, int newabs = SYN_MODEL_NEWABS(*synhw); unsigned char *buf = comm->protoBuf; struct SynapticsHwState *hw = &(comm->hwState); + SynapticsPrivate *priv = (SynapticsPrivate *)local->private; + SynapticsSHM *para = priv->synpara; int w, i; if (!ps2_synaptics_get_packet(local, synhw, proto_ops, comm)) @@ -709,7 +712,7 @@ PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw, hw->y = YMAX_NOMINAL + YMIN_NOMINAL - hw->y; - if (hw->z > 0) { + if (hw->z >= para->finger_high) { int w_ok = 0; /* * Use capability bits to decide if the w value is valid. -- 1.6.2.4