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

Event types delivered to `update/2`.

Every event arriving in `update/2` is one of these struct types:

- `WidgetEvent` - interactions with widgets and canvas elements
  (clicks, input, toggle, slide, drag, focus, etc.)
- `KeyEvent` - keyboard press and release
- `ModifiersEvent` - modifier key state changes (Shift, Ctrl, etc.)
- `ImeEvent` - input method editor composition
- `WindowEvent` - window lifecycle (opened, closed, resized, moved)
- `TimerEvent` - timer ticks from subscriptions
- `AsyncEvent` - results from async commands
- `StreamEvent` - intermediate values from streaming commands
- `EffectEvent` - platform effect responses (file dialogs, clipboard)
- `SystemEvent` - system queries and platform events
- `CommandError` - command failures

See the [Events reference](docs/reference/events.md) for the full
event model and routing details.

# `delivered_t`

```elixir
@type delivered_t() ::
  Plushie.Event.WidgetEvent.delivered_t()
  | Plushie.Event.KeyEvent.t()
  | Plushie.Event.ModifiersEvent.t()
  | Plushie.Event.ImeEvent.t()
  | Plushie.Event.WindowEvent.delivered_t()
  | Plushie.Event.EffectEvent.t()
  | Plushie.Event.CommandError.t()
  | Plushie.Event.SystemEvent.delivered_t()
  | Plushie.Event.TimerEvent.t()
  | Plushie.Event.AsyncEvent.t()
  | Plushie.Event.StreamEvent.t()
```

# `t`

```elixir
@type t() ::
  Plushie.Event.WidgetEvent.t()
  | Plushie.Event.KeyEvent.t()
  | Plushie.Event.ModifiersEvent.t()
  | Plushie.Event.ImeEvent.t()
  | Plushie.Event.WindowEvent.t()
  | Plushie.Event.EffectEvent.t()
  | Plushie.Event.CommandError.t()
  | Plushie.Event.SystemEvent.t()
  | Plushie.Event.TimerEvent.t()
  | Plushie.Event.AsyncEvent.t()
  | Plushie.Event.StreamEvent.t()
```

# `target`

```elixir
@spec target(event :: struct()) :: String.t()
```

Returns the full scoped path as a forward-order string.

Works with any event struct that has `id` and `scope` fields.
When the event has a `window_id` field, the window_id is stripped
from the scope (it appears at the end of the scope list but is not
part of the container path).

## Examples

    iex> Plushie.Event.target(%Plushie.Event.WidgetEvent{type: :click, id: "save", scope: ["main"], window_id: "main"})
    "save"

    iex> Plushie.Event.target(%Plushie.Event.WidgetEvent{type: :click, id: "save", scope: ["form", "sidebar", "main"], window_id: "main"})
    "sidebar/form/save"

---

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