androidx.compose.ui.input.indirect

Interfaces

IndirectTouchInputModifierNode

Implement this interface to create a Modifier.Node that can intercept indirect touch input events.

Cmn

Classes

IndirectTouchEvent

Represents a touch event that did not result from contact with a touchscreen.

Cmn
IndirectTouchEventType

Indicates the reason that the IndirectTouchEvent was sent.

Cmn

Extension functions summary

Modifier

Adding this modifier to the modifier parameter of a component will allow it to handle IndirectTouchEvents, if it (or one of its children) is focused.

Cmn
Modifier

Adding this modifier to the modifier parameter of a component will allow it to intercept IndirectTouchEvents before a focused child receives it in onIndirectTouchEvent, if it (or one of its children) is focused.

Cmn

Extension functions

onIndirectTouchEvent

@ExperimentalComposeUiApi
fun Modifier.onIndirectTouchEvent(
    onIndirectTouchEvent: (IndirectTouchEvent) -> Boolean
): Modifier

Adding this modifier to the modifier parameter of a component will allow it to handle IndirectTouchEvents, if it (or one of its children) is focused.

Parameters
onIndirectTouchEvent: (IndirectTouchEvent) -> Boolean

This callback is invoked when a user interacts with a touch input device that is not associated with a touchscreen. While implementing this callback, return true to stop propagation of this event. If you return false, the event will be sent to this IndirectTouchEvent's parent.

Returns
Modifier

true if the event is consumed, false otherwise.

onPreIndirectTouchEvent

@ExperimentalComposeUiApi
fun Modifier.onPreIndirectTouchEvent(
    onPreIndirectTouchEvent: (IndirectTouchEvent) -> Boolean
): Modifier

Adding this modifier to the modifier parameter of a component will allow it to intercept IndirectTouchEvents before a focused child receives it in onIndirectTouchEvent, if it (or one of its children) is focused.

Parameters
onPreIndirectTouchEvent: (IndirectTouchEvent) -> Boolean

This callback is invoked when a user interacts with a touch input device that is not associated with a touchscreen.s It gives ancestors of a focused component the chance to intercept an IndirectTouchEvent. Return true to indicate that you consumed the event and want to stop propagation of this event.

Returns
Modifier

true if the event is consumed, false otherwise.