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
+27
View File
@@ -111,6 +111,33 @@ private Q_SLOTS:
QCOMPARE(t.takeTrackpadSteps(), QPoint(-3, -1));
}
void spaceSlideSidewaysMovesAlongTheLine()
{
PointerTracker t(ofType(KeyType::Space), {100, 0}, config());
t.moveTo({112, 5});
QCOMPARE(t.gesture(), Gesture::Trackpad);
QCOMPARE(t.takeTrackpadSteps(), QPoint(1, 0)); // the slop counts
t.moveTo({75, -50});
QCOMPARE(t.takeTrackpadSteps(), QPoint(-3, 0)); // no line changes
QVERIFY(!t.longPressElapsed());
}
void spaceSlideVerticallyStaysTap()
{
PointerTracker t(ofType(KeyType::Space), {100, 0}, config());
t.moveTo({105, -20});
QCOMPARE(t.gesture(), Gesture::Tap);
}
void spaceSlideNeedsGestures()
{
PointerTracker::Config c = config();
c.gestures = false;
PointerTracker t(ofType(KeyType::Space), {100, 0}, c);
t.moveTo({140, 0});
QCOMPARE(t.gesture(), Gesture::Tap);
}
void layerKeySlides()
{
PointerTracker t(ofType(KeyType::LayerSwitch), {0, 0}, config());