---
title: "PointerEvent"
description: "Describes a pointer input change event that has occurred at a particular point in time."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

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


```kotlin
expect class PointerEvent
internal constructor(
    changes: List<PointerInputChange>,
    internalPointerEvent: InternalPointerEvent?,
)
```


Describes a pointer input change event that has occurred at a particular point in time.


## Secondary Constructors

```kotlin
constructor(changes: List<PointerInputChange>)
```


#### Parameters

| | |
| --- | --- |
| changes | The changes. |



## Properties

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


```kotlin
val changes: List<PointerInputChange>
```


The changes.



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


```kotlin
val buttons: PointerButtons
```


The state of buttons (e.g. mouse or stylus buttons) during this event.



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


```kotlin
val keyboardModifiers: PointerKeyboardModifiers
```


The state of modifier keys during this event.



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


```kotlin
var type: PointerEventType
```


The primary reason the `PointerEvent` was sent.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual class PointerEvent
internal actual constructor(
    /** The changes. */
    actual val changes: List<PointerInputChange>,
    internal val internalPointerEvent: InternalPointerEvent?,
)
```


Describes a pointer input change event that has occurred at a particular point in time.


## Secondary Constructors

```kotlin
actual constructor(changes: List<PointerInputChange>) : this(changes, null)
```


#### Parameters

| | |
| --- | --- |
| changes | The changes. |



## Properties

<div class='sourceset sourceset-android'>Android</div>


```kotlin
val motionEvent: MotionEvent?
```


The underlying Android `MotionEvent` that triggered this `PointerEvent`.

This property provides access to the raw `MotionEvent` for retrieving platform-specific
information not yet exposed by the Compose `PointerEvent` API (e.g., stylus tilt angle).

**Important Considerations:**
1. **Read-Only:** The returned `MotionEvent` is strictly read-only. Modifying it will lead to  unpredictable behavior.
2. **Transient:** Do not store a reference to this `MotionEvent`. The Android framework may  recycle it, rendering its state undefined and causing errors if accessed later. Access the  data only within the scope where the `PointerEvent` is received.
3. **Metadata Only:** This `MotionEvent` should *not* be used for primary input handling  logic (e.g., determining pointer position or button presses). Rely on the properties of  `PointerEvent` and `PointerInputChange` for this purpose. The `MotionEvent` is intended  solely for accessing supplemental metadata.
4. **Nullability:** This property will be `null` in two cases:   * The `PointerEvent` was fabricated within Compose (i.e., not directly from a system     input event).   * The `PointerEvent` has already been dispatched within the Compose input system. (See     the sample code for details).



<div class='sourceset sourceset-android'>Android</div>


```kotlin
@get:MotionEventClassification
val classification: Int
```


Returns
``MotionEvent`'s classification`(https://developer.android.com/reference/android/view/MotionEvent#getClassification()).



<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual val buttons = PointerButtons(motionEvent?.buttonState ?: 0)
```


<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual val keyboardModifiers = PointerKeyboardModifiers(motionEvent?.metaState ?: 0)
```


<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual var type: PointerEventType
```


## Functions

```kotlin
fun component1(): List<PointerInputChange>
```

```kotlin
fun copy(changes: List<PointerInputChange>, motionEvent: MotionEvent?): PointerEvent
```


