diff options
author | Peter Zotov <whitequark@whitequark.org> | 2012-03-02 11:21:36 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-03-05 12:11:44 +1000 |
commit | 704c0fa3b677d5d648d0ab9d65cd03043797f3bf (patch) | |
tree | 268093c4d5ad7f69935e885df6c96268b841bb2a /src/synaptics.c | |
parent | cddab79c408db3b13905a2be72aff4f7bf1406f8 (diff) |
Implement a workaround for Elantech touchpads
All Elantech touchpads report the number of fingers explicitly,
and at least the v3 version of the hardware can report any
pressure values down to zero. This interferes with the tap
detection hysteresis, which is required for dumb touchpads.
This commit implements a vendor-specific workaround for Elantech
touchpads which sets the FingerLow and FingerHigh options to 1
by default, effectively disabling the hysteresis mechanism.
Signed-off-by: Peter Zotov <whitequark@whitequark.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'src/synaptics.c')
-rw-r--r-- | src/synaptics.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index df95b12..f82264a 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -386,6 +386,25 @@ calculate_edge_widths(SynapticsPrivate *priv, int *l, int *r, int *t, int *b) *b = priv->maxy - eheight; } +static void +calculate_tap_hysteresis(SynapticsPrivate *priv, int range, + int *fingerLow, int *fingerHigh, int *fingerPress) +{ + if (priv->model == MODEL_ELANTECH) { + /* All Elantech touchpads don't need the Z filtering to get the + * number of fingers correctly. See Documentation/elantech.txt + * in the kernel. + */ + *fingerLow = priv->minp + 1; + *fingerHigh = priv->minp + 1; + } else { + *fingerLow = priv->minp + range * (25.0/256); + *fingerHigh = priv->minp + range * (30.0/256); + } + + *fingerPress = priv->minp + range * 1.000; +} + /* Area options support both percent values and absolute values. This is * awkward. The xf86Set* calls will print to the log, but they'll * also print an error if we request a percent value but only have an @@ -471,10 +490,9 @@ static void set_default_parameters(InputInfoPtr pInfo) range = priv->maxp - priv->minp + 1; + calculate_tap_hysteresis(priv, range, &fingerLow, &fingerHigh, &fingerPress); + /* scaling based on defaults and a pressure of 256 */ - fingerLow = priv->minp + range * (25.0/256); - fingerHigh = priv->minp + range * (30.0/256); - fingerPress = priv->minp + range * 1.000; emulateTwoFingerMinZ = priv->minp + range * (282.0/256); edgeMotionMinZ = priv->minp + range * (30.0/256); edgeMotionMaxZ = priv->minp + range * (160.0/256); |