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/Config.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/Config.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Config.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index 2c68c92..e02868a 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -160,15 +160,12 @@ final class Config // first iteration then automatically added. final Set<KeyValue> extra_keys = new HashSet<KeyValue>(this.extra_keys); KeyboardData kw = original_kw.mapKeys(new KeyboardData.MapKeyValues() { - public KeyValue apply(KeyValue key) + public KeyValue apply(KeyValue key, boolean localized) { - if (key == null) - return null; boolean is_extra_key = extra_keys.contains(key); if (is_extra_key) extra_keys.remove(key); - int flags = key.getFlags(); - if ((flags & KeyValue.FLAG_LOCALIZED) != 0 && !is_extra_key) + if (localized && !is_extra_key) return null; switch (key.getKind()) { @@ -193,7 +190,7 @@ final class Config break; case Modifier: if (lockable_modifiers.contains(key.getModifier())) - return key.withFlags(flags | KeyValue.FLAG_LOCK); + return key.withFlags(key.getFlags() | KeyValue.FLAG_LOCK); break; } return key; |
