From e10c587dc5286db64a6f55010637f0c3f9f62d59 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 5 Jun 2022 17:26:34 +0200 Subject: 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. --- srcs/juloo.keyboard2/Keyboard2.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'srcs/juloo.keyboard2/Keyboard2.java') 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; } -- cgit v1.2.3