diff options
| author | Jules Aguillon | 2023-02-12 23:20:11 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2023-02-12 23:20:11 +0100 |
| commit | 0f62b3044c501dc5679583e06447285ebeb31118 (patch) | |
| tree | cb3cd47834c464cf8884627fe1e350be03fb6b05 /srcs/juloo.keyboard2/Keyboard2.java | |
| parent | c46e3b6c619b6af5825161d4960ea4829a44d429 (diff) | |
| download | unexpected-keyboard-0f62b3044c501dc5679583e06447285ebeb31118.tar.gz unexpected-keyboard-0f62b3044c501dc5679583e06447285ebeb31118.zip | |
Option to switch to the previous input method
A new option changes the "change_method" into the new
"change_method_prev". It switch to the previously used input method.
A long press on "change_method_prev" sends "change_method".
A new section is added in the settings and existing options are moved.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index 0065e0d..54caf3c 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -329,11 +329,21 @@ public class Keyboard2 extends InputMethodService /** Not static */ public class Receiver implements KeyEventHandler.IReceiver { - public void switchToNextInputMethod() { + public void switchInputMethod() + { InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE); imm.showInputMethodPicker(); - // deprecated in version 28: imm.switchToNextInputMethod(getConnectionToken(), false); - // added in version 28: switchToNextInputMethod(false); + } + + public void switchToPrevInputMethod() + { + if (VERSION.SDK_INT < 28) + { + InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE); + imm.switchToLastInputMethod(getConnectionToken()); + } + else + Keyboard2.this.switchToPreviousInputMethod(); } public void setPane_emoji() |
