I have finished my ime custom keyboard. But I have some problems. When I type something into first textField and than try to type into second textField I can't delete anything into secon textfield.
This is code of my keybutton
val currentInputConnection = (context as IMEService).currentInputConnection
"delete" -> {
CoroutineScope(Dispatchers.Main).launch {
while (motionEvent.action == MotionEvent.ACTION_DOWN) {
currentInputConnection.sendKeyEvent(
KeyEvent(
KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL
)
)
}
}
}
What I need to do to fix it? image - this is my example.
I expect that key "delete" will work into any textfield. Now when I try to move to second textfield I can't delete any digitals or letter.