summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-12-16 09:43:40 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-04-30 12:52:40 +1000
commitc5e59d9d910e611687957736cdc58593c1f56439 (patch)
tree1e979c5fc3be5ce52a1cfeb2a42490fb7b87b1ff
parentda61d8b9dca8a94f95ba7d04673f27cecf35765b (diff)
On clickpads with two touchpoints, try to detect clickfinger 3 actions
Some touchpads provide BTN_TOOL_TRIPLETAP but do not track more than two touchpoints. For those, try to detect clickfinger3 actions as best as we can. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 51b6bf3c1083638527b18696c2b682fd78c97070)
-rw-r--r--src/synaptics.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 0986e20..0539066 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2584,6 +2584,28 @@ clickpad_guess_clickfingers(SynapticsPrivate * priv,
close_point >>= 1;
}
+ /* Some trackpads touchpad only track two touchpoints but announce
+ BTN_TOOL_TRIPLETAP (which sets hw->numFingers to 3).
+ This can affect clickfingers, in the following ways:
+ * one finger down: normal click
+ * two fingers down, close together: 2 finger click
+ * two fingers down, apart: normal click
+ * three fingers down, close together: 3 finger click
+ * three fingers down, with two grouped next to each other: should be
+ * 2-finger click but we can't detect this.
+ * so: if two detected fingers are close together and HW says three
+ * fingers, make it three fingers.
+ * if two detected fingers are apart and HW says three fingers, make
+ * it a two-finger click, guessing that the third finger is somewhere
+ * close to another finger.
+ */
+ if (hw->numFingers >= 3 && nfingers < hw->numFingers) {
+ if (!nfingers) /* touchpoints too far apart */
+ nfingers = 2;
+ else
+ nfingers++;
+ }
+
return nfingers;
}