abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Pointers.java
diff options
context:
space:
mode:
authorJules Aguillon2025-06-19 01:10:06 +0200
committerGitHub2025-06-19 01:10:06 +0200
commit42528ab211d440996d002441dc4f1b9db0e98525 (patch)
tree880faf315125af8da8edbab87fe566d8492c35c8 /srcs/juloo.keyboard2/Pointers.java
parent71d278402644fd16a2f407518346746f16538de6 (diff)
downloadunexpected-keyboard-42528ab211d440996d002441dc4f1b9db0e98525.tar.gz
unexpected-keyboard-42528ab211d440996d002441dc4f1b9db0e98525.zip
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.
Diffstat (limited to 'srcs/juloo.keyboard2/Pointers.java')
-rw-r--r--srcs/juloo.keyboard2/Pointers.java3
1 files changed, 1 insertions, 2 deletions
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]. */