abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
-rw-r--r--srcs/juloo.keyboard2/Pointers.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Pointers.java b/srcs/juloo.keyboard2/Pointers.java
index e6db206..1f0e44c 100644
--- a/srcs/juloo.keyboard2/Pointers.java
+++ b/srcs/juloo.keyboard2/Pointers.java
@@ -107,6 +107,11 @@ public final class Pointers implements Handler.Callback
public void onTouchDown(float x, float y, int pointerId, KeyboardData.Key key)
{
+ // Ignore new presses while a modulated key is active. On some devices,
+ // ghost touch events can happen while the pointer travels on top of other
+ // keys.
+ if (isModulatedKeyPressed())
+ return;
KeyValue value = key.key0;
Pointer ptr = new Pointer(pointerId, key, value, x, y);
_ptrs.add(ptr);
@@ -199,6 +204,16 @@ public final class Pointers implements Handler.Callback
}
}
+ private boolean isModulatedKeyPressed()
+ {
+ for (Pointer ptr : _ptrs)
+ {
+ if ((ptr.flags & KeyValue.FLAG_PRECISE_REPEAT) != 0)
+ return true;
+ }
+ return false;
+ }
+
// Key repeat
/** Message from [_keyrepeat_handler]. */