diff options
| author | Jules Aguillon | 2025-02-04 15:50:17 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2025-02-04 15:50:17 +0100 |
| commit | 0061911ef3a4c9339638571e2ddc5377adc25af1 (patch) | |
| tree | 8ad166162649e914f6f0a1c09b61450d9e3467f2 /srcs/juloo.keyboard2/KeyValue.java | |
| parent | 6b40803fa4fd5ac67c163db2175094ff103970c0 (diff) | |
| download | unexpected-keyboard-0061911ef3a4c9339638571e2ddc5377adc25af1.tar.gz unexpected-keyboard-0061911ef3a4c9339638571e2ddc5377adc25af1.zip | |
Pressing the compose key exits the pending sequence
Allows stopping a compose sequence without typing anything.
This is also a more intuitive behavior rather than starting a new
sequence.
Diffstat (limited to 'srcs/juloo.keyboard2/KeyValue.java')
| -rw-r--r-- | srcs/juloo.keyboard2/KeyValue.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index fea03fa..540138b 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -80,6 +80,7 @@ public final class KeyValue implements Comparable<KeyValue> public static enum Placeholder { REMOVED, + NOTHING, F11, F12, SHINDOT, @@ -380,6 +381,16 @@ 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) + { + // 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); + } + public static KeyValue makeStringKey(String str) { return makeStringKey(str, 0); |
