Fix auto-capitalisation interfering with caps lock

Add a flag to recognize fake pointers and avoid clearing the
intentionally locked shift key.
This commit is contained in:
Jules Aguillon 2022-07-30 18:14:05 +02:00
parent 85d798299e
commit 4f5ce66347
2 changed files with 3 additions and 2 deletions

View File

@ -59,6 +59,7 @@ final class KeyValue
public static final int FLAG_SMALLER_FONT = (1 << 25);
// Used by [Pointers].
public static final int FLAG_LOCKED = (1 << 26);
public static final int FLAG_FAKE_PTR = (1 << 27);
// Kinds
public static final int KIND_CHAR = (0 << 29);

View File

@ -81,14 +81,14 @@ public final class Pointers implements Handler.Callback
if (isKeyDown(key))
return;
Pointer ptr = new Pointer(-1, key, kv, 0.f, 0.f, Modifiers.EMPTY);
ptr.flags = ptr.flags & ~(KeyValue.FLAG_LATCH | KeyValue.FLAG_LOCK);
ptr.flags = ptr.flags & ~(KeyValue.FLAG_LATCH | KeyValue.FLAG_LOCK | KeyValue.FLAG_FAKE_PTR);
_ptrs.add(ptr);
}
public void remove_fake_pointer(KeyValue kv, KeyboardData.Key key)
{
Pointer ptr = getLatched(key, kv);
if (ptr != null)
if (ptr != null && (ptr.flags & KeyValue.FLAG_FAKE_PTR) != 0)
removePtr(ptr);
}