forked from extern/Unexpected-Keyboard
Clear cache when changing layout
Due to the modmap, the cache must be cleared when switching layout to or
from a layout that contain a modmap.
This is broken since 3f6b6fd23
, which moves the modmap handling into
KeyModifier.
This commit is contained in:
parent
5386541db3
commit
c7ed2bcae9
@ -13,7 +13,14 @@ public final class KeyModifier
|
|||||||
/** The optional modmap takes priority over modifiers usual behaviors. Set to
|
/** The optional modmap takes priority over modifiers usual behaviors. Set to
|
||||||
[null] to disable. */
|
[null] to disable. */
|
||||||
private static KeyboardData.Modmap _modmap = null;
|
private static KeyboardData.Modmap _modmap = null;
|
||||||
public static void set_modmap(KeyboardData.Modmap mm) { _modmap = mm; }
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/** Modify a key according to modifiers. */
|
/** Modify a key according to modifiers. */
|
||||||
public static KeyValue modify(KeyValue k, Pointers.Modifiers mods)
|
public static KeyValue modify(KeyValue k, Pointers.Modifiers mods)
|
||||||
|
Loading…
Reference in New Issue
Block a user