We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19ec2c8 commit 9ca863eCopy full SHA for 9ca863e
1 file changed
src/features/touchscreen/touchCypress/TouchCypress.cpp
@@ -341,7 +341,10 @@ bool Touch::getTouchData(struct cypressTouchData *_touchData)
341
_touchData->y[1] = _regs[11] << 8 | _regs[12];
342
_touchData->z[1] = _regs[13];
343
_touchData->detectionType = _regs[8];
344
- _touchData->fingers = _regs[2];
+
345
+ // Hardware can report spurious high finger counts (e.g. when palm-swiping).
346
+ // Clamp to 2 — the maximum the controller and all callers' arrays support.
347
+ _touchData->fingers = (_regs[2] > 2) ? 2 : _regs[2];
348
349
// Everything went ok? Return true.
350
return true;
0 commit comments