<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
value class KeyEvent(val nativeKeyEvent: NativeKeyEvent)
```


When a user presses a key on a hardware keyboard, a `KeyEvent` is sent to the item that is
currently focused. Any parent composable can intercept this `key event` on its way to
the focused item by using `Modifier.onPreviewKeyEvent()```onPreviewKeyEvent`. If the item is not
consumed, it returns back to each parent and can be intercepted by using
`Modifier.onKeyEvent()```onKeyEvent`.