https://kotlinlang.org logo
Title
e

Erlan Amanatov

05/10/2021, 3:48 AM
I am trying to switch focus to the next TextField on
TAB
pressed, but the problem is
TAB
key is not detected in
onKeyEvent
. Any ideas?
TextField(
                    modifier = Modifier
                        .onKeyEvent {
                            println("key -> ${it.key.keyCode}")
                            false
                        },
                   ...
                )
a

Andrew Rudenko [JB]

05/10/2021, 2:53 PM
it was consumed by textfield itself. use onPreviewKeyEvent to intercept events
e

Erlan Amanatov

05/10/2021, 3:38 PM
Same result, it is not detected there