From d771e9d2c7de7d62f5514995f4a224e1e293a376 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 10 Sep 2023 11:43:56 +0200 Subject: 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. --- srcs/juloo.keyboard2/Config.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/Config.java') 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 present = new HashSet(); - 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) { -- cgit v1.2.3