Refactor: Clearer names for CHANGE_METHOD* events

The keys are not renamed to retain compatibility.
This commit is contained in:
Jules Aguillon 2024-01-15 22:09:15 +01:00
parent b114c78bf1
commit d7fa5ffa9a
4 changed files with 8 additions and 8 deletions

View File

@ -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)

View File

@ -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");

View File

@ -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);

View File

@ -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