From ed4ba591349412d4466b4e55bb9e44eb427f13b0 Mon Sep 17 00:00:00 2001 From: merkost Date: Thu, 22 Jun 2023 19:12:13 +1000 Subject: [PATCH] Fixed on delete key click --- .../simplemobiletools/keyboard/services/SimpleKeyboardIME.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt index 3be9d3d..bd48770 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -104,8 +104,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared MyKeyboard.KEYCODE_DELETE -> { val selectedText = inputConnection.getSelectedText(0) if (TextUtils.isEmpty(selectedText)) { - inputConnection.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)) - inputConnection.sendKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)) + inputConnection.deleteSurroundingText(1, 0) } else { inputConnection.commitText("", 1) }