Cancel keys still down when hold-keys mode flips

The surface cancels its fingers under the old rules before the switch, so
a release no longer reaches the other mode (a stuck repeater or held
modifier one way, a second copy of the character the other). Sticky
modifiers, shift and dead keys start over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 10:13:41 +02:00
co-authored by Claude Opus 5.5
parent 3a62599a3f
commit 9abd19e5d3
4 changed files with 31 additions and 1 deletions
+16
View File
@@ -169,6 +169,22 @@ private Q_SLOTS:
controller->setOptions({});
}
void switchingHoldKeysMidPressCancelsTheKey()
{
const QPoint a = keyCenter(u"a"_s);
QTest::touchEvent(&window, touchscreen).press(0, a);
controller->setOptions({.holdKeys = true});
QTest::touchEvent(&window, touchscreen).release(0, a);
QVERIFY(engine.output.isEmpty());
QVERIFY(engine.keyEvents.isEmpty());
QTest::touchEvent(&window, touchscreen).press(0, a);
controller->setOptions({});
QTest::touchEvent(&window, touchscreen).release(0, a);
QVERIFY(engine.held.isEmpty());
QVERIFY(engine.output.isEmpty()); // not typed a second time as a tap
}
void slideFromNumbersKeyTypesAndReturns()
{
const QPoint layerKey = keyCenter(u".?123"_s, u"layer"_s);