PointerCaptureNode

Opts a pointer handler into exclusive delivery after it consumes a press.

The owner-thread runtime retains at most one captured node and its starting button per tree. A PointerEvent.Press returning InputResult.Consumed acquires capture only while no other handler owns it, then invokes onPointerCaptureAcquired. Captured moves and drags or releases for that same button bypass bounds and ancestor clips, use the latest committed local coordinates without clamping, and stop propagation even when the handler returns InputResult.Ignored. Other buttons, scrolling, and hit-tested hover observation retain their ordinary dispatch behavior. A matching release clears ownership before delivery and does not invoke onPointerCaptureCancelled. Removal, replacement, unplacement, input reset, detachment, close, and failure instead clear ownership before invoking cancellation once. Callback replacement on an otherwise retained node does not cancel capture. Implementations remain externally described and runtime-owned like ordinary PointerInputNode capabilities; no registration or component-specific dispatch is required. Callback failures escape unchanged through the active tree operation, which still attempts remaining cleanup.

Functions

Link copied to clipboard

Confirms that this node acquired one captured gesture on the owning tree thread.

Link copied to clipboard

Cancels one unfinished captured gesture on the owning tree thread.

Link copied to clipboard
abstract fun onPointerEvent(event: PointerEvent, localPosition: IntOffset): InputResult

Handles a pointer event after layout hit testing.