Android 12 Developer Preview is here! Try it out, and give us your feedback!

KeyEvent

inline class KeyEvent
kotlin.Any
   ↳ androidx.compose.ui.input.key.KeyEvent

When a user presses a key on a hardware keyboard, a KeyEvent is sent to the KeyInputModifier that is currently active.

Summary

Public constructors
<init>(nativeKeyEvent: NativeKeyEvent)

When a user presses a key on a hardware keyboard, a KeyEvent is sent to the KeyInputModifier that is currently active.

Properties
NativeKeyEvent

Extension properties
From androidx.compose.ui.input.key
actual Boolean

Indicates whether the Alt key is pressed.

actual Boolean

Indicates whether the Ctrl key is pressed.

actual Boolean

Indicates whether the Meta key is pressed.

actual Boolean

Indicates whether the Shift key is pressed.

actual Key

The key that was pressed.

actual KeyEventType

The type of key event.

actual Int

The UTF16 value corresponding to the key event that was pressed.

Public constructors

<init>

KeyEvent(nativeKeyEvent: NativeKeyEvent)

When a user presses a key on a hardware keyboard, a KeyEvent is sent to the KeyInputModifier that is currently active.

Properties

nativeKeyEvent

val nativeKeyEvent: NativeKeyEvent