How to detect soft-keyboard pressed when talkback is on

Viewed 50

When talkback is on. It seems like there is no way to detect soft-keyboard pressed

I tried to use both TextView.onKeyPreIme and TextView.setOnEditorActionListener but no luck.

Do you guys have any idea how to archive this?

class MyEditText @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : EditText(context, attrs, defStyleAttr) {

override fun onKeyPreIme(keyCode: Int, event: KeyEvent?): Boolean {
    interactor?.onSoftKeyBoardPressed(keyCode, event)
    return super.onKeyPreIme(keyCode, event)
}

init {
    setOnEditorActionListener { v, actionId, event ->
        log("Hi there", actionId.toString())
        false
    }
}}
0 Answers
Related