fix #30, fixing a glitch with backspace getting stuck

This commit is contained in:
tibbi 2022-03-09 13:44:37 +01:00
parent 00cd9b4442
commit 9c5cf0b1c9
1 changed files with 9 additions and 0 deletions

View File

@ -1002,6 +1002,15 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
if (ignoreTouches) {
if (action == MotionEvent.ACTION_UP) {
ignoreTouches = false
// fix a glitch with long pressing backspace, then clicking some letter
if (mRepeatKeyIndex != NOT_A_KEY) {
val key = mKeys[mRepeatKeyIndex]
if (key.code == KEYCODE_DELETE) {
mHandler?.removeMessages(MSG_REPEAT)
mRepeatKeyIndex = NOT_A_KEY
}
}
}
return true
}