onIndirectTouchEvent

Common

Modifier in Compose Ui

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

Last updated:

Installation

dependencies {
   implementation("androidx.compose.ui:ui:1.9.0-alpha01")
}

Overloads

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

Parameters

namedescription
onIndirectTouchEventThis 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.
by @alexstyl