abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyValue.java
diff options
context:
space:
mode:
authorJules Aguillon2024-03-11 00:10:12 +0100
committerJules Aguillon2024-03-11 00:24:25 +0100
commitb33bcd886532d9af7e9c80175196fbf1b8d27552 (patch)
tree4a9148e316fbc131f4573601c2e4faed5f239ba0 /srcs/juloo.keyboard2/KeyValue.java
parentc41a098924eab18ee05a94e41ce6e3b2c1665e7c (diff)
downloadunexpected-keyboard-b33bcd886532d9af7e9c80175196fbf1b8d27552.tar.gz
unexpected-keyboard-b33bcd886532d9af7e9c80175196fbf1b8d27552.zip
refactor: Use internal flags in Pointers
'FLAG_LOCKED' and 'FLAG_FAKE_PTR' are only used within Pointers. Define new flags in Pointers and remove these from KeyValue. Also allows to define new flags.
Diffstat (limited to 'srcs/juloo.keyboard2/KeyValue.java')
-rw-r--r--srcs/juloo.keyboard2/KeyValue.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java
index 1a0ed73..c9ecd66 100644
--- a/srcs/juloo.keyboard2/KeyValue.java
+++ b/srcs/juloo.keyboard2/KeyValue.java
@@ -98,6 +98,7 @@ public final class KeyValue
// Behavior flags.
public static final int FLAG_LATCH = (1 << FLAGS_OFFSET << 0);
+ // Key can be locked by typing twice
public static final int FLAG_LOCK = (1 << FLAGS_OFFSET << 1);
// Special keys are not repeated and don't clear latched modifiers.
public static final int FLAG_SPECIAL = (1 << FLAGS_OFFSET << 2);
@@ -109,13 +110,13 @@ public final class KeyValue
public static final int FLAG_SMALLER_FONT = (1 << FLAGS_OFFSET << 5); // 25% smaller symbols
public static final int FLAG_SECONDARY = (1 << FLAGS_OFFSET << 6); // dimmer
// Used by [Pointers].
- public static final int FLAG_LOCKED = (1 << FLAGS_OFFSET << 7);
- public static final int FLAG_FAKE_PTR = (1 << FLAGS_OFFSET << 8);
+ // Free: (1 << FLAGS_OFFSET << 7)
+ // Free: (1 << FLAGS_OFFSET << 8)
// Ranges for the different components
private static final int FLAGS_BITS =
FLAG_LATCH | FLAG_LOCK | FLAG_SPECIAL | FLAG_GREYED | FLAG_KEY_FONT |
- FLAG_SMALLER_FONT | FLAG_SECONDARY | FLAG_LOCKED | FLAG_FAKE_PTR;
+ FLAG_SMALLER_FONT | FLAG_SECONDARY;
private static final int KIND_BITS = (0b1111 << KIND_OFFSET); // 4 bits wide
private static final int VALUE_BITS = ~(FLAGS_BITS | KIND_BITS); // 20 bits wide