abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Pointers.java
diff options
context:
space:
mode:
authorJules Aguillon2022-03-15 20:44:02 +0100
committerJules Aguillon2022-03-15 20:44:02 +0100
commitd53ee811d97692cebe91a5d5d2207dca4d5b8fd8 (patch)
tree519b7d6f939f2295839f3c7717d0228fcb3711a1 /srcs/juloo.keyboard2/Pointers.java
parentfadedfd58f1bc62aea8e913662984f84f20631bf (diff)
downloadunexpected-keyboard-d53ee811d97692cebe91a5d5d2207dca4d5b8fd8.tar.gz
unexpected-keyboard-d53ee811d97692cebe91a5d5d2207dca4d5b8fd8.zip
Handle CANCEL touch events
Handling this event is part of the API but was never done. This caused unstoppable key-repeat. This event isn't common, the only way I found on Android 10 is to switch to the emoji keyboard while holding a key. Some apps might cause this event more often.
Diffstat (limited to 'srcs/juloo.keyboard2/Pointers.java')
-rw-r--r--srcs/juloo.keyboard2/Pointers.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Pointers.java b/srcs/juloo.keyboard2/Pointers.java
index 36a53d5..e6db206 100644
--- a/srcs/juloo.keyboard2/Pointers.java
+++ b/srcs/juloo.keyboard2/Pointers.java
@@ -95,6 +95,16 @@ public final class Pointers implements Handler.Callback
}
}
+ public void onTouchCancel(int pointerId)
+ {
+ Pointer ptr = getPtr(pointerId);
+ if (ptr == null)
+ return;
+ stopKeyRepeat(ptr);
+ removePtr(ptr);
+ _handler.onPointerFlagsChanged();
+ }
+
public void onTouchDown(float x, float y, int pointerId, KeyboardData.Key key)
{
KeyValue value = key.key0;