How can I capture key events happening on a `Click...
# compose-desktop
k
How can I capture key events happening on a
ClickableText
? I've tried with
Modifier.onPreviewKeyEvent
but nothing seems to be happening...
I have a single widget on the screen, and it (ClickableText) starts registering key events if I press a Tab key before... I guess it's not getting the focus somewhow?
I've tried with a FocusRequester(), then in the onClick handler calling focusRequester.requestFous(), but nothing's happening..
Huh, it seems I have to call .focusRequster() Modifier before calling .focusable(), otherwise it doesn't work, weird
s
Also, make sure to
remember
your
FocusRequester()
(It's easy to forget and a source of weird bugs)
👍 1