abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2.java
diff options
context:
space:
mode:
authorJules Aguillon2021-04-18 00:55:31 +0200
committerJules Aguillon2021-04-18 00:55:31 +0200
commitf8bce500ff3f870e6eadae591541a1210e458cff (patch)
tree168adda0641f5f90a29c295cc3f8317db96bacb7 /srcs/juloo.keyboard2/Keyboard2.java
parent1421bccc7b6588484fcf02517d35c98bbd05f6c4 (diff)
downloadunexpected-keyboard-f8bce500ff3f870e6eadae591541a1210e458cff.tar.gz
unexpected-keyboard-f8bce500ff3f870e6eadae591541a1210e458cff.zip
Hide the input switching key if it's not needed
Android has a new way of switching between input methods and this key need to be hidden in most cases.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java
index f4226f6..f94ef3a 100644
--- a/srcs/juloo.keyboard2/Keyboard2.java
+++ b/srcs/juloo.keyboard2/Keyboard2.java
@@ -100,6 +100,7 @@ public class Keyboard2 extends InputMethodService
public void onStartInputView(EditorInfo info, boolean restarting)
{
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
+ _config.shouldOfferSwitchingToNextInputMethod = imm.shouldOfferSwitchingToNextInputMethod(getCurrentInputBinding().getConnectionToken());
refreshSubtype(imm.getCurrentInputMethodSubtype());
if ((info.inputType & InputType.TYPE_CLASS_NUMBER) != 0)
_keyboardView.setKeyboard(getLayout(R.xml.numeric));
@@ -156,7 +157,7 @@ public class Keyboard2 extends InputMethodService
{
InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
- imm.switchToNextInputMethod(getWindow().getWindow().getAttributes().token, false);
+ imm.switchToNextInputMethod(getCurrentInputBinding().getConnectionToken(), false);
}
else if ((flags & (KeyValue.FLAG_CTRL | KeyValue.FLAG_ALT)) != 0)
handleMetaKeyUp(key, flags);