Merge pull request #234 from esensar/fix/fast-typing-delay-remove

Ensure no multiple capital letters appear without using delay
This commit is contained in:
Tibor Kaputa 2023-08-31 20:12:45 +02:00 committed by GitHub
commit e4c6ad9769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 10 deletions

View File

@ -260,14 +260,13 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
} }
} }
inputConnection.commitText(codeChar.toString(), 1) inputConnection.commitText(codeChar.toString(), 1)
updateShiftKeyState()
} }
} }
else -> { else -> {
inputConnection.commitText(codeChar.toString(), 1) inputConnection.commitText(codeChar.toString(), 1)
if (originalText == null) { updateShiftKeyState()
updateShiftKeyState()
}
} }
} }
} }

View File

@ -1218,14 +1218,12 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
val secondKeyIndex = getPressedKeyIndex(newPointerX, newPointerY) val secondKeyIndex = getPressedKeyIndex(newPointerX, newPointerY)
showPreview(secondKeyIndex) showPreview(secondKeyIndex)
mHandler!!.postDelayed({ detectAndSendKey(secondKeyIndex, newPointerX, newPointerY, eventTime)
detectAndSendKey(secondKeyIndex, newPointerX, newPointerY, eventTime)
val secondKeyCode = mKeys.getOrNull(secondKeyIndex)?.code val secondKeyCode = mKeys.getOrNull(secondKeyIndex)?.code
if (secondKeyCode != null) { if (secondKeyCode != null) {
mOnKeyboardActionListener!!.onPress(secondKeyCode) mOnKeyboardActionListener!!.onPress(secondKeyCode)
} }
}, REPEAT_INTERVAL.toLong())
showPreview(NOT_A_KEY) showPreview(NOT_A_KEY)
invalidateKey(mCurrentKey) invalidateKey(mCurrentKey)