<div class='sourceset sourceset-common'>Common</div>

> **Deprecated** Use awaitEachGesture instead. forEachGesture() can drop events between gestures.

<h2 id="foreachgesture-block">forEachGesture</h2>

```kotlin
suspend fun PointerInputScope.forEachGesture(block: suspend PointerInputScope.() -> Unit)
```

Repeatedly calls `block` to handle gestures. If there is a `CancellationException`, it will wait
until all pointers are raised before another gesture is detected, or it exits if `isActive` is
`false`.

[awaitEachGesture](/jetpack-compose/androidx.compose.foundation/foundation/functions/awaitEachGesture) does the same thing without the possibility of missing events between
gestures, but also lacks the ability to call arbitrary suspending functions within `block`.