diff options
| author | Jules Aguillon | 2022-06-24 20:26:27 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2022-06-24 20:26:27 +0200 |
| commit | ab987c776c7ddc0fab594f20f4ddf49d98848ccd (patch) | |
| tree | abf1c5cbeaecbb30bb67e57db6044117a7260a4a /srcs/juloo.keyboard2/Pointers.java | |
| parent | 6e5be63e25bf2ff2de5c9de5ccd4bc581c639155 (diff) | |
| download | unexpected-keyboard-ab987c776c7ddc0fab594f20f4ddf49d98848ccd.tar.gz unexpected-keyboard-ab987c776c7ddc0fab594f20f4ddf49d98848ccd.zip | |
Fix localized key not in predefined position
The "loc " prefix for predefining a place for an "extra key" was broken
since 31d6a70.
The FLAG_LOCALIZED flag cannot be used anymore, as adding it to any key
would turn it into a different key that wouldn't be recognized by parts
of the code comparing the keys (placing the extra keys).
Add an other layer in KeyboardData to store such informations.
Diffstat (limited to 'srcs/juloo.keyboard2/Pointers.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Pointers.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Pointers.java b/srcs/juloo.keyboard2/Pointers.java index 0548b88..1bb358c 100644 --- a/srcs/juloo.keyboard2/Pointers.java +++ b/srcs/juloo.keyboard2/Pointers.java @@ -140,7 +140,7 @@ public final class Pointers implements Handler.Callback // Don't take latched modifiers into account if an other key is pressed. // The other key already "own" the latched modifiers and will clear them. Modifiers mods = getModifiers(isOtherPointerDown()); - KeyValue value = _handler.modifyKey(key.key0, mods); + KeyValue value = handleKV(key.key0, mods); Pointer ptr = new Pointer(pointerId, key, value, x, y, mods); _ptrs.add(ptr); if (value != null && !value.hasFlags(KeyValue.FLAG_SPECIAL)) @@ -159,7 +159,7 @@ public final class Pointers implements Handler.Callback private KeyValue getKeyAtDirection(Pointer ptr, int direction) { if (direction == 0) - return _handler.modifyKey(ptr.key.key0, ptr.modifiers); + return handleKV(ptr.key.key0, ptr.modifiers); KeyValue k; for (int i = 0; i > -3; i = (~i>>31) - i) { @@ -173,6 +173,13 @@ public final class Pointers implements Handler.Callback return null; } + private KeyValue handleKV(KeyboardData.Corner c, Modifiers modifiers) + { + if (c == null) + return null; + return _handler.modifyKey(c.kv, modifiers); + } + public void onTouchMove(float x, float y, int pointerId) { Pointer ptr = getPtr(pointerId); |
