diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java index cd18c30..8d5fbbb 100644 --- a/srcs/juloo.keyboard2/KeyModifier.java +++ b/srcs/juloo.keyboard2/KeyModifier.java @@ -6,19 +6,11 @@ import java.util.HashMap; public final class KeyModifier { - /** Cache key is KeyValue's name */ - private static HashMap> _cache = - new HashMap>(); - /** The optional modmap takes priority over modifiers usual behaviors. Set to [null] to disable. */ private static KeyboardData.Modmap _modmap = null; public static void set_modmap(KeyboardData.Modmap mm) { - // Clear the cache when switching to or from a layout that contain a modmap - // as the cache would otherwise override the modmap. - if (_modmap != null || mm != null) - _cache.clear(); _modmap = mm; } @@ -28,15 +20,9 @@ public final class KeyModifier if (k == null) return null; int n_mods = mods.size(); - HashMap ks = cacheEntry(k); - KeyValue r = ks.get(mods); - if (r == null) - { - r = k; - for (int i = 0; i < n_mods; i++) - r = modify(r, mods.get(i)); - ks.put(mods, r); - } + KeyValue r = k; + for (int i = 0; i < n_mods; i++) + r = modify(r, mods.get(i)); /* Keys with an empty string are placeholder keys. */ if (r.getString().length() == 0) return null; @@ -529,18 +515,6 @@ public final class KeyModifier return shifted; } - /* Lookup the cache entry for a key. Create it needed. */ - private static HashMap cacheEntry(KeyValue k) - { - HashMap ks = _cache.get(k); - if (ks == null) - { - ks = new HashMap(); - _cache.put(k, ks); - } - return ks; - } - public static abstract class Map_char { /** Modify a char or return [null] if the modifier do not apply. Return a