mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-02-19 21:30:47 +01:00
Fixed capitalization scenario when cursor is moved
This commit is contained in:
parent
5e50feea90
commit
cca92c784a
@ -6,6 +6,7 @@ import android.text.InputType.*
|
|||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.inputmethod.CursorAnchorInfo
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.view.inputmethod.EditorInfo.IME_ACTION_NONE
|
import android.view.inputmethod.EditorInfo.IME_ACTION_NONE
|
||||||
import android.view.inputmethod.EditorInfo.IME_FLAG_NO_ENTER_ACTION
|
import android.view.inputmethod.EditorInfo.IME_FLAG_NO_ENTER_ACTION
|
||||||
@ -72,7 +73,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateShiftKeyState() {
|
private fun updateShiftKeyState() {
|
||||||
if (keyboard!!.mShiftState == ShiftState.ON_PERMANENT) {
|
if (keyboard?.mShiftState == ShiftState.ON_PERMANENT) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,6 +259,11 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
|
|||||||
updateShiftKeyState()
|
updateShiftKeyState()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onUpdateCursorAnchorInfo(cursorAnchorInfo: CursorAnchorInfo?) {
|
||||||
|
super.onUpdateCursorAnchorInfo(cursorAnchorInfo)
|
||||||
|
updateShiftKeyState()
|
||||||
|
}
|
||||||
|
|
||||||
private fun moveCursor(moveRight: Boolean) {
|
private fun moveCursor(moveRight: Boolean) {
|
||||||
val extractedText = currentInputConnection?.getExtractedText(ExtractedTextRequest(), 0) ?: return
|
val extractedText = currentInputConnection?.getExtractedText(ExtractedTextRequest(), 0) ?: return
|
||||||
var newCursorPosition = extractedText.selectionStart
|
var newCursorPosition = extractedText.selectionStart
|
||||||
|
Loading…
x
Reference in New Issue
Block a user