# PointerCaptureComponentTester

Artifact: [androidx.xr.scenecore:scenecore-testing](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/testing/PointerCaptureComponentTester.kt+class:androidx.xr.scenecore.testing.PointerCaptureComponentTester) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
class PointerCaptureComponentTester
```

<br />

*** ** * ** ***

A test-only accessor for `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/PointerCaptureComponent` that enables direct manipulation and inspection of its internal state.

## Summary

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/PointerCaptureComponentTester#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/PointerCaptureComponentTester#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/PointerCaptureComponentTester#triggerOnInputEvent(androidx.xr.scenecore.InputEvent)(event: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent)` Simulates an input event from the runtime. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/PointerCaptureComponentTester#triggerOnStateChanged(androidx.xr.scenecore.PointerCaptureComponent.PointerCaptureState)( newState: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/PointerCaptureComponent.PointerCaptureState )` Simulates a pointer capture state change event. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### triggerOnInputEvent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
fun triggerOnInputEvent(event: InputEvent): Unit
```

Simulates an input event from the runtime.

This triggers the inputListener passed to `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/PointerCaptureComponent#create(androidx.xr.runtime.Session,java.util.concurrent.Executor,java.util.function.Consumer,java.util.function.Consumer)` on the `https://developer.android.com/reference/java/util/concurrent/Executor.html` specified there.

| Parameters |
|---|---|
| `event: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent` | The input event that occurred. |

### triggerOnStateChanged

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
fun triggerOnStateChanged(
    newState: PointerCaptureComponent.PointerCaptureState
): Unit
```

Simulates a pointer capture state change event.

This triggers the stateListener passed to `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/PointerCaptureComponent#create(androidx.xr.runtime.Session,java.util.concurrent.Executor,java.util.function.Consumer,java.util.function.Consumer)` on the `https://developer.android.com/reference/java/util/concurrent/Executor.html` specified there.

| Parameters |
|---|---|
| `newState: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/PointerCaptureComponent.PointerCaptureState` | The new `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/PointerCaptureComponent.PointerCaptureState` of pointer capture. |