Merge pull request #203 from Merkost/termux_fix

Fixed termux issue
This commit is contained in:
Tibor Kaputa 2023-06-23 09:39:35 +02:00 committed by GitHub
commit a467961e06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -162,7 +162,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
else -> {
var codeChar = code.toChar()
val originalText = inputConnection.getExtractedText(ExtractedTextRequest(), 0)?.text ?: return
val originalText = inputConnection.getExtractedText(ExtractedTextRequest(), 0)?.text
if (Character.isLetter(codeChar) && keyboard!!.mShiftState > ShiftState.OFF) {
codeChar = Character.toUpperCase(codeChar)
@ -179,6 +179,9 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
}
} else {
inputConnection.commitText(codeChar.toString(), 1)
if (originalText == null) {
updateShiftKeyState()
}
}
}
}