diff options
| author | Jules Aguillon | 2022-06-05 17:26:34 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2022-06-05 17:46:22 +0200 |
| commit | e10c587dc5286db64a6f55010637f0c3f9f62d59 (patch) | |
| tree | 2c39dd330f1915e3c1f8bb353c5db13c3a6c3bd4 /srcs/juloo.keyboard2/Keyboard2.java | |
| parent | d03e96da3e99e1e0edb78367499c22f574079583 (diff) | |
| download | unexpected-keyboard-e10c587dc5286db64a6f55010637f0c3f9f62d59.tar.gz unexpected-keyboard-e10c587dc5286db64a6f55010637f0c3f9f62d59.zip | |
Refactor: Abstract KeyValue fields
The meaning of the public fields of KeyValue was quite complicated and
not handled consistently accross the app.
Make these fields private and add a more abstract API on top.
The meaning of these fields changed recently and it wasn't an easy
change. I plan on making more changes in the future.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index d0e56a2..24ec4a4 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -298,7 +298,9 @@ public class Keyboard2 extends InputMethodService getLayout(_config.programming_layout).mapKeys(new KeyboardData.MapKeyValues() { public KeyValue apply(KeyValue key) { - if (key != null && key.code == KeyValue.EVENT_SWITCH_PROGRAMMING) + if (key != null + && key.getKind() == KeyValue.Kind.Event + && key.getEvent() == KeyValue.EVENT_SWITCH_PROGRAMMING) return KeyValue.getKeyByName("switch_text"); return key; } |
