Slide sideways on space to move the cursor

As on phone keyboards: a sideways move on space moves the cursor right
away, along the line only, without blanking the keys. Long-press space
still opens the full trackpad.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 17:51:09 +01:00
co-authored by Claude Opus 5.5
parent b745e9da1b
commit 441c1d615b
5 changed files with 51 additions and 4 deletions
+11
View File
@@ -208,6 +208,17 @@ private Q_SLOTS:
QCOMPARE(engine.output, QString());
QCOMPARE(engine.keysyms, (QList<quint32>{XKB_KEY_Right, XKB_KEY_Right, XKB_KEY_Right}));
}
void spaceSlideMovesCursorAtOnce()
{
const QPoint space = keyCenter({}, u"space"_s);
QTest::touchEvent(&window, touchscreen).press(0, space);
QTest::touchEvent(&window, touchscreen).move(0, space - QPoint(30, 0));
QVERIFY(!qobject_cast<KeyboardSurface *>(keyboard)->isTrackpadActive()); // keys keep their labels
QTest::touchEvent(&window, touchscreen).release(0, space - QPoint(30, 0));
QCOMPARE(engine.output, QString());
QCOMPARE(engine.keysyms, (QList<quint32>{XKB_KEY_Left, XKB_KEY_Left}));
}
};
QTEST_MAIN(TestKeyboardSurface)