abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Config.java
diff options
context:
space:
mode:
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
-rw-r--r--srcs/juloo.keyboard2/Config.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index da78f7f..bde4aea 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -9,8 +9,10 @@ import android.util.TypedValue;
import android.view.KeyEvent;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
final class Config
@@ -59,8 +61,8 @@ final class Config
public int actionId; // Meaningful only when 'actionLabel' isn't 'null'
public boolean swapEnterActionKey; // Swap the "enter" and "action" keys
public ExtraKeys extra_keys_subtype;
- public Set<KeyValue> extra_keys_param;
- public List<KeyValue> extra_keys_custom;
+ public Map<KeyValue, KeyboardData.PreferredPos> extra_keys_param;
+ public Map<KeyValue, KeyboardData.PreferredPos> extra_keys_custom;
public final IKeyEventHandler handler;
public boolean orientation_landscape = false;
@@ -174,16 +176,16 @@ final class Config
final KeyValue action_key = action_key();
// Extra keys are removed from the set as they are encountered during the
// first iteration then automatically added.
- final Set<KeyValue> extra_keys = new HashSet<KeyValue>();
+ final Map<KeyValue, KeyboardData.PreferredPos> extra_keys = new HashMap<KeyValue, KeyboardData.PreferredPos>();
final Set<KeyValue> remove_keys = new HashSet<KeyValue>();
- extra_keys.addAll(extra_keys_param);
- extra_keys.addAll(extra_keys_custom);
+ extra_keys.putAll(extra_keys_param);
+ extra_keys.putAll(extra_keys_custom);
if (extra_keys_subtype != null)
{
Set<KeyValue> present = new HashSet<KeyValue>();
present.addAll(kw.getKeys().keySet());
- present.addAll(extra_keys_param);
- present.addAll(extra_keys_custom);
+ present.addAll(extra_keys_param.keySet());
+ present.addAll(extra_keys_custom.keySet());
extra_keys_subtype.compute(extra_keys,
new ExtraKeys.Query(kw.script, present));
}
@@ -193,7 +195,7 @@ final class Config
kw = kw.mapKeys(new KeyboardData.MapKeyValues() {
public KeyValue apply(KeyValue key, boolean localized)
{
- boolean is_extra_key = extra_keys.contains(key);
+ boolean is_extra_key = extra_keys.containsKey(key);
if (is_extra_key)
extra_keys.remove(key);
if (localized && !is_extra_key)
@@ -246,7 +248,7 @@ final class Config
if (number_row)
kw = kw.addNumberRow();
if (extra_keys.size() > 0)
- kw = kw.addExtraKeys(extra_keys.iterator());
+ kw = kw.addExtraKeys(extra_keys.entrySet().iterator());
return kw;
}