Google berkomitmen untuk mendorong terwujudnya keadilan rasial bagi komunitas Kulit Hitam. Lihat caranya.

androidx.ui.core.keyinput

Interfaces

KeyEvent2

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.

KeyEvent

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

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: (KeyEvent2) -> 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: (KeyEvent2) -> Boolean): Modifier

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

Parameters
onKeyEvent: (KeyEvent2) -> 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: (KeyEvent2) -> Boolean): Modifier

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

Parameters
onPreviewKeyEvent: (KeyEvent2) -> 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.