# PointerEventPass

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/input/pointer/PointerEvent.kt+class:androidx.compose.ui.input.pointer.PointerEventPass) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  enum PointerEventPass : Enum<PointerEventPass>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[PointerEventPass](https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass)\> ||
|   | ↳ | [androidx.compose.ui.input.pointer.PointerEventPass](https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass) |

*** ** * ** ***

The enumeration of passes where `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange` traverses up and down the UI tree.

PointerInputChanges traverse throw the hierarchy in the following passes:

1. `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#Initial`: Down the tree from ancestor to descendant.

2. `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#Main`: Up the tree from descendant to ancestor.

3. `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#Final`: Down the tree from ancestor to descendant.

These passes serve the following purposes:

1. Initial: Allows ancestors to consume aspects of `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange` before descendants. This is where, for example, a scroller may block buttons from getting tapped by other fingers once scrolling has started.

2. Main: The primary pass where gesture filters should react to and consume aspects of `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange`s. This is the primary path where descendants will interact with `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange`s before parents. This allows for buttons to respond to a tap before a container of the bottom to respond to a tap.

3. Final: This pass is where children can learn what aspects of `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange`s were consumed by parents during the `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#Main` pass. For example, this is how a button determines that it should no longer respond to fingers lifting off of it because a parent scroller has consumed movement in a `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange`.

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#Final` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#Initial` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#Main` |   |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass>` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#values()()` Returns an array containing the constants of this enum type, in the order they're declared. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass>` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. | Cmn |

## Enum Values

### Final

```
val PointerEventPass.Final: PointerEventPass
```

### Initial

```
val PointerEventPass.Initial: PointerEventPass
```

### Main

```
val PointerEventPass.Main: PointerEventPass
```

## Public functions

### valueOf

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun valueOf(value: String): PointerEventPass
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun values(): Array<PointerEventPass>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

Cmn

```
val entries: EnumEntries<PointerEventPass>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.