public interface AwaitPointerEventScope : Density
Receiver scope for awaiting pointer events in a call to PointerInputScope.awaitPointerEventScope.
This is a restricted suspension scope. Code in this scope is always called un-dispatched and may only suspend for calls to awaitPointerEvent. 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.
Properties
size
public 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.
extendedTouchPadding
public val extendedTouchPadding: Size
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. / public val size: IntSize
/* The additional space applied to each side of the layout area. This can be non-zero when minimumTouchTargetSize is set in pointerInput.
currentEvent
public val currentEvent: PointerEvent
The PointerEvent from the most recent touch event.
viewConfiguration
public val viewConfiguration: ViewConfiguration
The ViewConfiguration used to tune gesture detectors.
Functions
awaitPointerEvent
public 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.
withTimeoutOrNull
public suspend fun <T> withTimeoutOrNull(
timeMillis: Long,
block: suspend AwaitPointerEventScope.() -> T,
): T?
Runs block and returns the result of block or null if timeMillis has passed before timeMillis.
withTimeout
public suspend fun <T> withTimeout(
timeMillis: Long,
block: suspend AwaitPointerEventScope.() -> T,
): T
Runs block and returns its results. An PointerEventTimeoutCancellationException is thrown if timeMillis has passed before block completes.