diff options
| author | Jules Aguillon | 2021-12-28 17:47:18 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2021-12-28 17:47:18 +0100 |
| commit | 15ce200ce3f9d19f1a1f1fb43f176bf511f14271 (patch) | |
| tree | 9a001552834b4f70f04bea80d1f3bdaaed935eef /srcs/juloo.keyboard2/Config.java | |
| parent | 0190cfc29a07a5a281f0fd1bdac4999ba65c19ba (diff) | |
| download | unexpected-keyboard-15ce200ce3f9d19f1a1f1fb43f176bf511f14271.tar.gz unexpected-keyboard-15ce200ce3f9d19f1a1f1fb43f176bf511f14271.zip | |
Separate "handler" code
As with the previous commit, remove casts of the context.
The "handler" object is referenced in the "config" object for now.
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Config.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index e7a793a..73c43be 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -34,7 +34,9 @@ final class Config public boolean shouldOfferSwitchingToNextInputMethod; public int accent_flags_to_remove; - private Config(Context context) + public final IKeyEventHandler handler; + + private Config(Context context, IKeyEventHandler h) { Resources res = context.getResources(); // static values @@ -61,6 +63,7 @@ final class Config // initialized later shouldOfferSwitchingToNextInputMethod = false; accent_flags_to_remove = 0; + handler = h; } /* @@ -120,13 +123,18 @@ final class Config private static Config _globalConfig = null; - public static void initGlobalConfig(Context context) + public static void initGlobalConfig(Context context, IKeyEventHandler handler) { - _globalConfig = new Config(context); + _globalConfig = new Config(context, handler); } public static Config globalConfig() { return _globalConfig; } + + public static interface IKeyEventHandler + { + public void handleKeyUp(KeyValue value, int flags); + } } |
