aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Wahlberg <freebsd@robertwahlberg.se>2025-12-01 20:42:15 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2025-12-01 20:42:15 +0000
commite3201cec8381c0582374f93991eff4a71bb95e9b (patch)
treee6ca3861cb8d217f7644b929fde6a9b34c1e8dad
parentb6cad334e649f49c57da52b139de353ad9078985 (diff)
psm: Fix three finger tap on elantech v4 touchpads
Fix an issue where a three finger tap would generate additional events when fingers moved slightly during the tap. Signed-off-by: Robert Wahlberg <freebsd@robertwahlberg.se> Pull Request: https://github.com/freebsd/freebsd-src/pull/1792 Reviewed by: wulf MFC after: 1 month
-rw-r--r--sys/dev/atkbdc/psm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index 137758b104d3..d36396df0fa0 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -4666,6 +4666,13 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
mask = sc->elanaction.mask;
nfingers = bitcount(mask);
+ /* The motion packet can only update two fingers at a time.
+ * Copy the previous state to get all active fingers. */
+ for (id = 0; id < ELANTECH_MAX_FINGERS; id++)
+ if (sc->elanaction.mask & (1 << id))
+ f[id] = sc->elanaction.fingers[id];
+
+ /* Update finger positions from the new packet */
scale = (pb->ipacket[0] & 0x10) ? 5 : 1;
for (i = 0; i <= 3; i += 3) {
id = ((pb->ipacket[i] & 0xe0) >> 5) - 1;