From 9f22e53a3ba8f064e69e3a84c371a7f29ee9e05c Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 29 Sep 2024 21:58:22 +0200 Subject: Add complex keys (#774) This allows to add new kinds of keys that need more data without making KeyValue's footprint bigger for common keys. This changes the [_symbol] field into [_payload], which holds the same as the previous field for more common keys but can hold bigger objects for keys of the new "Complex" kind. This also adds a complex key: String keys with a symbol different than the outputted string. Unit tests are added as the Java language is not helpful in making robust code.--- srcs/juloo.keyboard2/prefs/CustomExtraKeysPreference.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'srcs/juloo.keyboard2/prefs') diff --git a/srcs/juloo.keyboard2/prefs/CustomExtraKeysPreference.java b/srcs/juloo.keyboard2/prefs/CustomExtraKeysPreference.java index cf47d46..fda07ec 100644 --- a/srcs/juloo.keyboard2/prefs/CustomExtraKeysPreference.java +++ b/srcs/juloo.keyboard2/prefs/CustomExtraKeysPreference.java @@ -40,7 +40,7 @@ public class CustomExtraKeysPreference extends ListGroupPreference if (key_names != null) { for (String key_name : key_names) - kvs.put(KeyValue.makeStringKey(key_name), KeyboardData.PreferredPos.DEFAULT); + kvs.put(KeyValue.parseKeyDefinition(key_name), KeyboardData.PreferredPos.DEFAULT); } return kvs; } -- cgit v1.2.3