mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-06-05 21:49:26 +02:00
Ensure no multiple capital letters appear without using delay
This fixes the issue of capitalizing two letters when SHIFT is active, but it does not use delay. It instead always updates shift state right right after a key press, to ensure it is in the right state as soon as next key is typed. This removes the delay added in #210.
This commit is contained in:
@ -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()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
Reference in New Issue
Block a user