abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2
diff options
context:
space:
mode:
authorJules Aguillon2022-07-30 18:14:05 +0200
committerJules Aguillon2022-07-30 18:14:05 +0200
commit4f5ce6634780520391bec039977119562e208516 (patch)
tree082f8011e0735fad3f303dbc3a0e11a0a182802a /srcs/juloo.keyboard2
parent85d798299eaee3affc9e548975c9f3dac390e6e3 (diff)
downloadunexpected-keyboard-4f5ce6634780520391bec039977119562e208516.tar.gz
unexpected-keyboard-4f5ce6634780520391bec039977119562e208516.zip
Fix auto-capitalisation interfering with caps lock
Add a flag to recognize fake pointers and avoid clearing the intentionally locked shift key.
Diffstat (limited to 'srcs/juloo.keyboard2')
-rw-r--r--srcs/juloo.keyboard2/KeyValue.java1
-rw-r--r--srcs/juloo.keyboard2/Pointers.java4
2 files changed, 3 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java
index 383af8c..1bd8432 100644
--- a/srcs/juloo.keyboard2/KeyValue.java
+++ b/srcs/juloo.keyboard2/KeyValue.java
@@ -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);
diff --git a/srcs/juloo.keyboard2/Pointers.java b/srcs/juloo.keyboard2/Pointers.java
index a9d3b64..2ac55bb 100644
--- a/srcs/juloo.keyboard2/Pointers.java
+++ b/srcs/juloo.keyboard2/Pointers.java
@@ -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);
}