Merge pull request #189 from Merkost/scandinavian_fix

Keyboard change layout button fix
This commit is contained in:
Tibor Kaputa 2023-06-13 10:03:18 +02:00 committed by GitHub
commit 44d913bfec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -1079,8 +1079,8 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
// 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) {
val key = mKeys.getOrNull(mRepeatKeyIndex)
if (key?.code == KEYCODE_DELETE) {
mHandler?.removeMessages(MSG_REPEAT)
mRepeatKeyIndex = NOT_A_KEY
}
@ -1315,12 +1315,13 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
}
showPreview(NOT_A_KEY)
Arrays.fill(mKeyIndices, NOT_A_KEY)
val currentKeyCode = mKeys.getOrNull(mCurrentKey)?.code
// If we're not on a repeating key (which sends on a DOWN event)
if (mRepeatKeyIndex == NOT_A_KEY && !mMiniKeyboardOnScreen && !mAbortKey) {
detectAndSendKey(mCurrentKey, touchX, touchY, eventTime)
}
if (mKeys.getOrNull(mCurrentKey)?.code == KEYCODE_SPACE && !mIsLongPressingSpace) {
} else if (currentKeyCode == KEYCODE_SPACE && !mIsLongPressingSpace) {
detectAndSendKey(mCurrentKey, touchX, touchY, eventTime)
}