diff options
| author | Jules Aguillon | 2023-09-10 11:43:56 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2023-09-10 11:43:56 +0200 |
| commit | d771e9d2c7de7d62f5514995f4a224e1e293a376 (patch) | |
| tree | 8593ae2b8ac9fa9040acb04ba42424a845684615 /srcs/juloo.keyboard2/Config.java | |
| parent | 44e2e86f19bd9e7acddad50506dad0737fa032d9 (diff) | |
| download | unexpected-keyboard-d771e9d2c7de7d62f5514995f4a224e1e293a376.tar.gz unexpected-keyboard-d771e9d2c7de7d62f5514995f4a224e1e293a376.zip | |
Refactor: Compute key positions in layouts
`KeyboardData.getKeys()` now returns a map of the keys present on the
layout to their position. Positions are the row, column and swipe
direction.
The computed map is cached in the KeyboardData object as it might be
accessed later by `findKeyWithValue`, which now do less work.
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Config.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index 30be772..da78f7f 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -181,7 +181,7 @@ final class Config if (extra_keys_subtype != null) { Set<KeyValue> present = new HashSet<KeyValue>(); - kw.getKeys(present); + present.addAll(kw.getKeys().keySet()); present.addAll(extra_keys_param); present.addAll(extra_keys_custom); extra_keys_subtype.compute(extra_keys, @@ -189,7 +189,7 @@ final class Config } boolean number_row = this.number_row && !show_numpad; if (number_row) - KeyboardData.number_row.getKeys(remove_keys); + remove_keys.addAll(KeyboardData.number_row.getKeys(0).keySet()); kw = kw.mapKeys(new KeyboardData.MapKeyValues() { public KeyValue apply(KeyValue key, boolean localized) { |
