Allow complex keys in custom extra keys prefs

This commit is contained in:
Jules Aguillon 2024-09-28 16:30:45 +02:00
parent 390db36af7
commit 1809e6e589
2 changed files with 2 additions and 2 deletions

View File

@ -454,7 +454,7 @@ public final class KeyValue implements Comparable<KeyValue>
return new KeyValue("", Kind.Modifier, mod.ordinal(), 0); return new KeyValue("", Kind.Modifier, mod.ordinal(), 0);
} }
private static KeyValue parseKeyDefinition(String str) public static KeyValue parseKeyDefinition(String str)
{ {
if (str.length() < 2 || str.charAt(0) != ':') if (str.length() < 2 || str.charAt(0) != ':')
return makeStringKey(str); return makeStringKey(str);

View File

@ -40,7 +40,7 @@ public class CustomExtraKeysPreference extends ListGroupPreference<String>
if (key_names != null) if (key_names != null)
{ {
for (String key_name : key_names) 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; return kvs;
} }