# 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)

*** ** * ** ***


```
public final class PointerCaptureComponentTester
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/PointerCaptureComponentTester#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/PointerCaptureComponentTester#hashCode()()` |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/PointerCaptureComponentTester#triggerOnInputEvent(androidx.xr.scenecore.InputEvent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/InputEvent event)` Simulates an input event from the runtime. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/PointerCaptureComponentTester#triggerOnStateChanged(androidx.xr.scenecore.PointerCaptureComponent.PointerCaptureState)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PointerCaptureComponent.PointerCaptureState newState )` Simulates a pointer capture state change event. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### hashCode

```
public int hashCode()
```

### triggerOnInputEvent

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

```
public final void triggerOnInputEvent(@NonNull InputEvent event)
```

Simulates an input event from the runtime.

This triggers the inputListener passed to `https://developer.android.com/reference/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/InputEvent event` | The input event that occurred. |

### triggerOnStateChanged

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

```
public final void triggerOnStateChanged(
    @NonNull PointerCaptureComponent.PointerCaptureState newState
)
```

Simulates a pointer capture state change event.

This triggers the stateListener passed to `https://developer.android.com/reference/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PointerCaptureComponent.PointerCaptureState newState` | The new `https://developer.android.com/reference/androidx/xr/scenecore/PointerCaptureComponent.PointerCaptureState` of pointer capture. |