Fix adding two pointers for the same key

This commit is contained in:
Jules Aguillon 2022-11-06 19:49:30 +01:00
parent d2128e777e
commit 96db0397f0

View File

@ -77,7 +77,8 @@ public final class Pointers implements Handler.Callback
/** Fake pointers are latched and not lockable. */
public void add_fake_pointer(KeyValue kv, KeyboardData.Key key, boolean locked)
{
remove_fake_pointer(kv, key);
if (getLatched(key, kv) != null)
return; // Already latched, don't add an other pointer.
Pointer ptr = new Pointer(-1, key, kv, 0.f, 0.f, Modifiers.EMPTY);
ptr.flags &= ~KeyValue.FLAG_LATCH;
ptr.flags |= KeyValue.FLAG_LOCK | KeyValue.FLAG_FAKE_PTR;