From d7fa5ffa9a49789bc3cd966cd8067fa54dd69703 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Mon, 15 Jan 2024 22:09:15 +0100 Subject: [PATCH] Refactor: Clearer names for CHANGE_METHOD* events The keys are not renamed to retain compatibility. --- srcs/juloo.keyboard2/Config.java | 2 +- srcs/juloo.keyboard2/KeyModifier.java | 2 +- srcs/juloo.keyboard2/KeyValue.java | 8 ++++---- srcs/juloo.keyboard2/Keyboard2.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index f59bce3..e37ab0f 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -237,7 +237,7 @@ public final class Config case Event: switch (key.getEvent()) { - case CHANGE_METHOD: + case CHANGE_METHOD_PICKER: if (!shouldOfferSwitchingToNextInputMethod) return null; if (switch_input_immediate) diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java index c0f5beb..8e5bb8a 100644 --- a/srcs/juloo.keyboard2/KeyModifier.java +++ b/srcs/juloo.keyboard2/KeyModifier.java @@ -75,7 +75,7 @@ public final class KeyModifier case Event: switch (k.getEvent()) { - case CHANGE_METHOD_PREV: + case CHANGE_METHOD_AUTO: return KeyValue.getKeyByName("change_method"); case SWITCH_VOICE_TYPING: return KeyValue.getKeyByName("voice_typing_chooser"); diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 24eab0b..27ceaf4 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -12,8 +12,8 @@ public final class KeyValue SWITCH_NUMERIC, SWITCH_EMOJI, SWITCH_BACK_EMOJI, - CHANGE_METHOD, - CHANGE_METHOD_PREV, + CHANGE_METHOD_PICKER, + CHANGE_METHOD_AUTO, ACTION, SWITCH_FORWARD, SWITCH_BACKWARD, @@ -365,8 +365,8 @@ public final class KeyValue case "switch_forward": return eventKey(0xE013, Event.SWITCH_FORWARD, FLAG_SMALLER_FONT); case "switch_backward": return eventKey(0xE014, Event.SWITCH_BACKWARD, FLAG_SMALLER_FONT); case "switch_greekmath": return eventKey("πλ∇¬", Event.SWITCH_GREEKMATH, FLAG_SMALLER_FONT); - case "change_method": return eventKey(0xE009, Event.CHANGE_METHOD, FLAG_SMALLER_FONT); - case "change_method_prev": return eventKey(0xE009, Event.CHANGE_METHOD_PREV, FLAG_SMALLER_FONT); + case "change_method": return eventKey(0xE009, Event.CHANGE_METHOD_PICKER, FLAG_SMALLER_FONT); + case "change_method_prev": return eventKey(0xE009, Event.CHANGE_METHOD_AUTO, FLAG_SMALLER_FONT); case "action": return eventKey("Action", Event.ACTION, FLAG_SMALLER_FONT); // Will always be replaced case "capslock": return eventKey(0xE012, Event.CAPS_LOCK, 0); case "voice_typing": return eventKey(0xE015, Event.SWITCH_VOICE_TYPING, FLAG_SMALLER_FONT); diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index daa9ea0..9b71954 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -386,11 +386,11 @@ public class Keyboard2 extends InputMethodService setInputView(_keyboardView); break; - case CHANGE_METHOD: + case CHANGE_METHOD_PICKER: get_imm().showInputMethodPicker(); break; - case CHANGE_METHOD_PREV: + case CHANGE_METHOD_AUTO: if (VERSION.SDK_INT < 28) get_imm().switchToLastInputMethod(getConnectionToken()); else