# `Plushie.Type.Pointer`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/type/pointer.ex#L1)

Event field types for unified pointer events.

Provides pointer type and button parsing for the unified pointer event
model that replaces the old canvas_*/mouse_*/sensor_* event families.

## Pointer types

- `:mouse` - standard mouse input
- `:touch` - touchscreen finger
- `:pen` - stylus or pen tablet

## Buttons

- `:left`, `:right`, `:middle` - standard three-button mouse
- `:back`, `:forward` - extended navigation buttons

## Examples

    iex> Plushie.Type.Pointer.parse_pointer("mouse")
    {:ok, :mouse}

    iex> Plushie.Type.Pointer.parse_button("right")
    {:ok, :right}

# `button`

```elixir
@type button() :: :left | :right | :middle | :back | :forward
```

# `pointer_type`

```elixir
@type pointer_type() :: :mouse | :touch | :pen
```

# `parse`

```elixir
@spec parse(value :: term()) :: {:ok, pointer_type()} | :error
```

# `parse_button`

```elixir
@spec parse_button(value :: term()) :: {:ok, button()} | :error
```

Parses a wire-format button string into an atom.

Returns `{:ok, button}` or `:error`. Defaults to `:left` when nil
(press/release events without an explicit button are left clicks).

# `parse_pointer`

```elixir
@spec parse_pointer(value :: term()) :: {:ok, pointer_type()} | :error
```

Parses a wire-format pointer type string into an atom.

Returns `{:ok, pointer_type}` or `:error`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
