PointerInputScope
@JvmDefaultWithCompatibility
interface PointerInputScope : Density
Receiver scope for Modifier.pointerInput
that permits
handling pointer input
.
Properties
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.
val extendedTouchPadding: Size
The additional space applied to each side of the layout area when the layout is smaller than
ViewConfiguration.minimumTouchTargetSize
.
val viewConfiguration: ViewConfiguration
The ViewConfiguration
used to tune gesture detectors.
@JsName("varinterceptOutOfBoundsChildEvents")
var interceptOutOfBoundsChildEvents: Boolean
Intercept pointer input that children receive even if the pointer is out of bounds.
If true
, and a child has been moved out of this layout and receives an event, this will
receive that event. If false
, a child receiving pointer input outside of the bounds of this
layout will not trigger any events in this.
Functions
suspend fun <R> awaitPointerEventScope(block: suspend AwaitPointerEventScope.() -> R): R
Suspend and install a pointer input block
that can await input events and respond to them
immediately. A call to awaitPointerEventScope
will resume with block
's result after it
completes.
More than one awaitPointerEventScope
can run concurrently in the same PointerInputScope
by using kotlinx.coroutines.launch
. block
s are dispatched to in the order in which they
were installed.