# PointerState

`import { PointerState } from "destack:input/binding";`

Pointer state snapshot.

```ds title="PointerState"
export struct PointerState {
    timestampNs: uint64;
    sequence: uint64;
    deviceId: string;
    pointerId: uint64;
    pointerKind: PointerKind;
    isPrimary: boolean;
    space: CoordinateSpace;
    x: float64;
    y: float64;
    deltaX: float64;
    deltaY: float64;
    buttons: uint32;
    modifiers: ModifierState;
    pen: PenState;
    contact: PointerContact;
}
```

[language/library/src/input/binding/pointer.ds:108:139](https://github.com/destack-sh/destack/blob/main/language/library/src/input/binding/pointer.ds#L108-L139)

## Members

### `timestampNs: uint64`

Monotonic update timestamp in nanoseconds.

### `sequence: uint64`

Monotonic sequence number generated by the host stream.

### `deviceId: string`

Stable source device identifier.

### `pointerId: uint64`

Stable pointer identifier for this active pointer.

### `pointerKind: PointerKind`

Pointer kind.

### `isPrimary: boolean`

Whether this is the primary pointer for its kind.

### `space: CoordinateSpace`

Position coordinate space.

### `x: float64`

Pointer x position.

### `y: float64`

Pointer y position.

### `deltaX: float64`

Relative x delta since the previous snapshot when available.

### `deltaY: float64`

Relative y delta since the previous snapshot when available.

### `buttons: uint32`

Canonical pressed-button bitset.

### `modifiers: ModifierState`

Keyboard modifier and lock state.

### `pen: PenState`

Pen state when available.

### `contact: PointerContact`

Contact geometry when available.
