Skip to content

Commit a3442e5

Browse files
author
Robert Wahlberg
committed
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 <[email protected]>
1 parent 0576863 commit a3442e5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sys/dev/atkbdc/psm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4666,6 +4666,13 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
46664666
mask = sc->elanaction.mask;
46674667
nfingers = bitcount(mask);
46684668

4669+
/* The motion packet can only update two fingers at a time.
4670+
* Copy the previous state to get all active fingers. */
4671+
for (id = 0; id < ELANTECH_MAX_FINGERS; id++)
4672+
if (sc->elanaction.mask & (1 << id))
4673+
f[id] = sc->elanaction.fingers[id];
4674+
4675+
/* Update finger positions from the new packet */
46694676
scale = (pb->ipacket[0] & 0x10) ? 5 : 1;
46704677
for (i = 0; i <= 3; i += 3) {
46714678
id = ((pb->ipacket[i] & 0xe0) >> 5) - 1;

0 commit comments

Comments
 (0)