diff options
| author | Jules Aguillon | 2025-02-08 23:16:18 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2025-02-08 23:16:18 +0100 |
| commit | d3753cc455b22bdaf7e687632f2ae089409e2bdb (patch) | |
| tree | 7439d1c211233b1cc2177c7bb9337fab5346d52d /srcs/juloo.keyboard2/KeyValue.java | |
| parent | 96dabde7c81d04b36cbe5054649535b968594508 (diff) | |
| download | unexpected-keyboard-d3753cc455b22bdaf7e687632f2ae089409e2bdb.tar.gz unexpected-keyboard-d3753cc455b22bdaf7e687632f2ae089409e2bdb.zip | |
Add a glyph for cancelling the compose key
Diffstat (limited to 'srcs/juloo.keyboard2/KeyValue.java')
| -rw-r--r-- | srcs/juloo.keyboard2/KeyValue.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 91cf634..1c2f10f 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -80,7 +80,7 @@ public final class KeyValue implements Comparable<KeyValue> public static enum Placeholder { REMOVED, - NOTHING, + COMPOSE_CANCEL, F11, F12, SHINDOT, @@ -381,14 +381,10 @@ public final class KeyValue implements Comparable<KeyValue> return new KeyValue("", Kind.Placeholder, id.ordinal(), 0); } - /** Make a key that does nothing, inheriting the symbol from an other key. */ - public static KeyValue nothingKey(KeyValue inherit) + private static KeyValue placeholderKey(int symbol, Placeholder id, int flags) { - // Keep only appearance flags - int flags = inherit.getFlags() & (FLAG_SPECIAL | FLAG_GREYED | - FLAG_KEY_FONT | FLAG_SMALLER_FONT | FLAG_SECONDARY); - return new KeyValue(inherit.getString(), Kind.Placeholder, - Placeholder.NOTHING.ordinal(), flags); + return new KeyValue(String.valueOf((char)symbol), Kind.Placeholder, + id.ordinal(), flags | FLAG_KEY_FONT); } public static KeyValue makeStringKey(String str) @@ -698,6 +694,7 @@ public final class KeyValue implements Comparable<KeyValue> /* The compose key */ case "compose": return makeComposePending(0xE016, ComposeKeyData.compose, FLAG_SECONDARY | FLAG_SPECIAL); + case "compose_cancel": return placeholderKey(0xE01A, Placeholder.COMPOSE_CANCEL, FLAG_SECONDARY | FLAG_SPECIAL); /* Placeholder keys */ case "removed": return placeholderKey(Placeholder.REMOVED); |
