# PointerInputFilter

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.PointerInputFilter) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  abstract class PointerInputFilter
  ```

*** ** * ** ***

A PointerInputFilter represents a single entity that receives `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange`s), interprets them, and consumes the aspects of the changes that it is react to such that other PointerInputFilters don't also react to them.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter#PointerInputFilter()()` | Cmn |

| ### Public functions |
|---|---|---|
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter#onCancel()()` Invoked to notify the handler that no more calls to `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter` will be made, until at least new pointers exist. | Cmn |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter#onPointerEvent(androidx.compose.ui.input.pointer.PointerEvent,androidx.compose.ui.input.pointer.PointerEventPass,androidx.compose.ui.unit.IntSize)( pointerEvent: https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEvent, pass: https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass, bounds: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize )` Invoked when pointers that previously hit this `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter` have changed. | Cmn |

| ### Public properties |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter#interceptOutOfBoundsChildEvents()` Intercept pointer input that children receive even if the pointer is out of bounds. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter#shareWithSiblings()` If `false`, then this `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter` will not allow siblings under it to respond to events. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter#size()` The layout size assigned to this `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter`. | Cmn |

## Public constructors

### PointerInputFilter

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

```
PointerInputFilter()
```

## Public functions

### onCancel

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

```
abstract fun onCancel(): Unit
```

Invoked to notify the handler that no more calls to `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter` will be made, until at least new pointers exist. This can occur for a few reasons:

1. Android dispatches ACTION_CANCEL to Compose.

2. This `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter` is no longer associated with a LayoutNode.

3. This `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter`'s associated LayoutNode is no longer in the composition tree.

### onPointerEvent

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

```
abstract fun onPointerEvent(
    pointerEvent: PointerEvent,
    pass: PointerEventPass,
    bounds: IntSize
): Unit
```

Invoked when pointers that previously hit this `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter` have changed. It is expected that any `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange`s that are used during this event and should not be considered valid to be used in other filters should be marked as consumed by calling `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange#consume()`.

| Parameters |
|---|---|
| `pointerEvent: https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEvent` | The list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange`s with positions relative to this `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter`. |
| `pass: https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass` in which this function is being called. |
| `bounds: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` | The width and height associated with this `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter`. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventPass` |   |

## Public properties

### interceptOutOfBoundsChildEvents

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

```
open val 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.

### shareWithSiblings

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

```
open val shareWithSiblings: Boolean
```

If `false`, then this `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter` will not allow siblings under it to respond to events. If `true`, this will have the first chance to respond and the next sibling under will then get a chance to respond as well. This trigger acts at the Layout level, so if any `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter`s on a Layout has `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter#shareWithSiblings()` set to `true` then the Layout will share with siblings.

Setting this true everywhere or high in the UI tree can negatively impact performance. Therefore, use it sparingly and only at the nearest shared parent of the two target UI elements.

### size

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

```
val size: IntSize
```

The layout size assigned to this `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputFilter`.