Google is committed to advancing racial equity for Black communities. See how.

PointerInputScope

interface PointerInputScope : Density
androidx.compose.ui.input.pointer.PointerInputScope

Receiver scope for Modifier.pointerInput that permits handling pointer input and sending custom input events.

Summary

Public methods
abstract suspend R
handlePointerInput(handler: suspend HandlePointerInputScope.() -> R)

Suspend and install a pointer input handler that can await input events and respond to them immediately.

Inherited functions
Properties
abstract CustomEventDispatcher

customEventDispatcher permits dispatching custom input events to the rest of the UI in response to handling lower-level pointer input events.

abstract IntSize

The measured size of the pointer input region.

Inherited properties

Public methods

handlePointerInput

abstract suspend fun <R> handlePointerInput(handler: suspend HandlePointerInputScope.() -> R): R

Suspend and install a pointer input handler that can await input events and respond to them immediately. A call to handlePointerInput will resume with handler's result after it completes.

More than one handlePointerInput can run concurrently in the same PointerInputScope by using kotlinx.coroutines.launch. Handlers are dispatched to in the order in which they were installed.

Properties

customEventDispatcher

abstract val customEventDispatcher: CustomEventDispatcher

customEventDispatcher permits dispatching custom input events to the rest of the UI in response to handling lower-level pointer input events. Accessing customEventDispatcher before the first pointer input event is reported will throw IllegalStateException.

size

abstract val size: IntSize

The measured size of the pointer input region. Input events will be reported with a coordinate space of (0, 0) to (size.width, size,height) as the input region, with (0, 0) indicating the upper left corner.