switch to letters keyboard after pressing space

This commit is contained in:
tibbi 2022-01-19 13:00:58 +01:00
parent 48eea0b26b
commit 05f98338a9
1 changed files with 7 additions and 1 deletions

View File

@ -145,7 +145,13 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
} }
inputConnection.commitText(code.toString(), 1) inputConnection.commitText(code.toString(), 1)
if (keyboard!!.shiftState == SHIFT_ON_ONE_CHAR) { if (primaryCode == MyKeyboard.KEYCODE_SPACE && keyboardMode != KEYBOARD_LETTERS) {
keyboardMode = KEYBOARD_LETTERS
keyboard = MyKeyboard(this, R.xml.keys_letters, enterKeyType)
keyboardView!!.setKeyboard(keyboard!!)
}
if (keyboard!!.shiftState == SHIFT_ON_ONE_CHAR && keyboardMode == KEYBOARD_LETTERS) {
keyboard!!.shiftState = SHIFT_OFF keyboard!!.shiftState = SHIFT_OFF
keyboardView!!.invalidateAllKeys() keyboardView!!.invalidateAllKeys()
} }