From 42528ab211d440996d002441dc4f1b9db0e98525 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Thu, 19 Jun 2025 01:10:06 +0200 Subject: Improve selection mode when selection ends cross (#1013) Emptying the selection with the spacebar slider puts the selection mode in an unexpected state. This checks that this doesn't happen. The selection ends can now cross each other, reversing the selection order. Special care is made to make sure that the sliders go in the expected direction. Pointers is changed to send a `onPointerDown` for the first slider event instead of a `onPointerHold`. This event is detected in `KeyEventHandler` and the selection ends are reordered if needed when sliding again.--- srcs/juloo.keyboard2/Pointers.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/Pointers.java') diff --git a/srcs/juloo.keyboard2/Pointers.java b/srcs/juloo.keyboard2/Pointers.java index 7cd52c5..28c2fa0 100644 --- a/srcs/juloo.keyboard2/Pointers.java +++ b/srcs/juloo.keyboard2/Pointers.java @@ -306,7 +306,6 @@ public final class Pointers implements Handler.Callback // Start sliding mode if (new_value.getKind() == KeyValue.Kind.Slider) startSliding(ptr, x, y, dx, dy, new_value); - _handler.onPointerDown(new_value, true); } } @@ -469,7 +468,7 @@ public final class Pointers implements Handler.Callback stopLongPress(ptr); ptr.flags |= FLAG_P_SLIDING; ptr.sliding = new Sliding(x, y, dirx, diry, kv.getSlider()); - _handler.onPointerHold(kv, ptr.modifiers); + _handler.onPointerDown(kv, true); } /** Return the [FLAG_P_*] flags that correspond to pressing [kv]. */ -- cgit v1.2.3