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

HandlePointerInputScope

interface HandlePointerInputScope
androidx.compose.ui.input.pointer.HandlePointerInputScope

Receiver scope for awaiting pointer events in a call to PointerInputScope.handlePointerInput.

This is a restricted suspension scope. Code in this scope is always called undispatched and may only suspend for calls to awaitPointerEvent or awaitCustomEvent. These functions resume synchronously and the caller may mutate the result before the next await call to affect the next stage of the input processing pipeline.

Summary

Public methods
abstract suspend CustomEvent
awaitCustomEvent(pass: PointerEventPass = PointerEventPass.Main)

Suspend until a CustomEvent is reported to the specified input pass.

abstract suspend PointerEvent
awaitPointerEvent(pass: PointerEventPass = PointerEventPass.Main)

Suspend until a PointerEvent is reported to the specified input pass.

Public methods

awaitCustomEvent

abstract suspend fun awaitCustomEvent(pass: PointerEventPass = PointerEventPass.Main): CustomEvent

Suspend until a CustomEvent is reported to the specified input pass. pass defaults to PointerEventPass.Main.

awaitCustomEvent resumes synchronously in the restricted suspension scope. This means that callers can react immediately to input after awaitCustomEvent returns and affect both the current frame and the next handler or phase of the input processing pipeline. Callers should mutate the returned CustomEvent before awaiting another event to consume aspects of the event before the next stage of input processing runs.

awaitPointerEvent

abstract suspend fun awaitPointerEvent(pass: PointerEventPass = PointerEventPass.Main): PointerEvent

Suspend until a PointerEvent is reported to the specified input pass. pass defaults to PointerEventPass.Main.

awaitPointerEvent resumes synchronously in the restricted suspension scope. This means that callers can react immediately to input after awaitPointerEvent returns and affect both the current frame and the next handler or phase of the input processing pipeline. Callers should mutate the returned PointerEvent before awaiting another event to consume aspects of the event before the next stage of input processing runs.