Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

androidx.compose.ui.input.key

Interfaces

Alt

Indicates the status of the Alt key.

KeyEvent

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

Classes

Key

Actual implementation of Key for Android.

Annotations

ExperimentalKeyInput

Enums

KeyEventType

The type of Key Event.

Extension functions summary

For Modifier
Modifier

Adding this modifier to the modifier parameter of a component will allow it to intercept hardware key events.

Modifier
Modifier.previewKeyInputFilter(onPreviewKeyEvent: (KeyEvent) -> Boolean)

Adding this modifier to the modifier parameter of a component will allow it to intercept hardware key events.

Extension functions

keyInputFilter

fun Modifier.keyInputFilter(onKeyEvent: (KeyEvent) -> Boolean): Modifier

Adding this modifier to the modifier parameter of a component will allow it to intercept hardware key events.

Parameters
onKeyEvent: (KeyEvent) -> Boolean This callback is invoked when the user interacts with the hardware keyboard. While implementing this callback, return true to stop propagation of this event. If you return false, the key event will be sent to this keyInputFilter's parent.

previewKeyInputFilter

fun Modifier.previewKeyInputFilter(onPreviewKeyEvent: (KeyEvent) -> Boolean): Modifier

Adding this modifier to the modifier parameter of a component will allow it to intercept hardware key events.

Parameters
onPreviewKeyEvent: (KeyEvent) -> Boolean This callback is invoked when the user interacts with the hardware keyboard. It gives ancestors of a focused component the chance to intercept a KeyEvent. Return true to stop propagation of this event. If you return false, the key event will be sent to this previewKeyInputFilter's child. If none of the children consume the event, it will be sent back up to the root keyInputFilter using the onKeyEvent callback.