onKeyEvent
Installs a KeyListener whose every event is forwarded to onKeyEvent.
onKeyEvent receives each KeyEvent (KEY_PRESSED / KEY_RELEASED / KEY_TYPED, read from event.id) and returns true if it consumed the event - in which case the event stops further processing, mirroring Compose's onKeyEvent. The component must be focusable and focused to receive these (see focusable); for shortcuts that should work regardless of which component holds focus, prefer onKeyStroke.
Multiple onKeyEvent applications all fire. onKeyEvent is read live, so passing a fresh lambda each recomposition is fine.
Return
this chain with the key listener declared on it.
Parameters
invoked for each key event before the component's key bindings see it, so consuming an event also keeps an onKeyStroke binding on the same component from firing.