Skip to content

Commit eb03579

Browse files
authored
Merge pull request #202 from Merkost/delete_fix
Fixed on delete key click
2 parents 637f069 + ed4ba59 commit eb03579

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
104104
MyKeyboard.KEYCODE_DELETE -> {
105105
val selectedText = inputConnection.getSelectedText(0)
106106
if (TextUtils.isEmpty(selectedText)) {
107-
inputConnection.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
108-
inputConnection.sendKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL))
107+
inputConnection.deleteSurroundingText(1, 0)
109108
} else {
110109
inputConnection.commitText("", 1)
111110
}

0 commit comments

Comments
 (0)