abouttreesummaryrefslogcommitdiff
path: root/srcs
diff options
context:
space:
mode:
authorJules Aguillon2023-01-29 18:49:44 +0100
committerJules Aguillon2023-01-29 18:49:44 +0100
commit7bc93c470e9e052e4b487e0a2c87f1bffaffd8ec (patch)
treeda30df0e00b3dacf8b50fc5fe04f4775ada12a7d /srcs
parent854eff211d62d566fdd3938a4bca1b0d63ad5958 (diff)
downloadunexpected-keyboard-7bc93c470e9e052e4b487e0a2c87f1bffaffd8ec.tar.gz
unexpected-keyboard-7bc93c470e9e052e4b487e0a2c87f1bffaffd8ec.zip
Don't send event at end of sliding
A sliding pointer going up must not cause a key event to be sent. This caused an extra cursor movement and cleared the latched modifiers.
Diffstat (limited to 'srcs')
-rw-r--r--srcs/juloo.keyboard2/Pointers.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Pointers.java b/srcs/juloo.keyboard2/Pointers.java
index 9ce34a2..63a5596 100644
--- a/srcs/juloo.keyboard2/Pointers.java
+++ b/srcs/juloo.keyboard2/Pointers.java
@@ -103,6 +103,11 @@ public final class Pointers implements Handler.Callback
Pointer ptr = getPtr(pointerId);
if (ptr == null)
return;
+ if (ptr.sliding)
+ {
+ onTouchUp_sliding(ptr);
+ return;
+ }
stopKeyRepeat(ptr);
Pointer latched = getLatched(ptr);
if (latched != null) // Already latched
@@ -382,6 +387,14 @@ public final class Pointers implements Handler.Callback
ptr.sliding_count = (int)(initial_dy / _config.slide_step_px);
}
+ /** Handle a sliding pointer going up. Latched modifiers are not cleared to
+ allow easy adjustments to the cursors. The pointer is cancelled. */
+ void onTouchUp_sliding(Pointer ptr)
+ {
+ removePtr(ptr);
+ _handler.onPointerFlagsChanged(false);
+ }
+
/** Handle move events for sliding pointers. [dx] is distance travelled from
[downX]. */
void onTouchMove_sliding(Pointer ptr, float dx)