# `Emerge.Config.Input`
[🔗](https://github.com/emerge-elixir/emerge/blob/v0.5.1/lib/emerge/config/input.ex#L1)

Raw input observation, scroll distance and cursor settings. Set this record as
`Emerge.Config.input`. Ordinary element interactions do not require subscriptions.

```elixir
%Emerge.Config{
  input: %Emerge.Config.Input{events: [:key, :pointer_button, :resize]}
}
```

## Fields

- `events` — raw categories forwarded to `c:Emerge.handle_input/2`; defaults to
  `[]` (none). Choose `:key`, `:text`, `:pointer_move`, `:pointer_button`,
  `:pointer_scroll`, `:pointer_enter`, `:resize` and/or `:focus`.
  `all_events/0` returns all eight. Duplicates and order do not matter.
  Integers, `nil`, `:all` and `:none` are not accepted.
- `scroll_line_pixels` — positive pixel distance per wheel/line-scroll step;
  defaults to `30.0`. Precise pixel-scroll input is not converted into line steps.
- `cursor` — `Emerge.Config.Cursor`, defaulting to its built-in cursor settings.

Subscriptions filter only raw callbacks, not buttons, element key bindings,
text editing, scrolling or `c:Emerge.handle_close/2`. The `:text` category includes
committed text and IME updates. Enter/focus describe a window, not an element.
See the [input guide](handle_input.html) and `Emerge.Input` for callback values
and which events each backend can provide.

## Changing settings

`events` can change through `config` and replaces the entire subscription list.
Messages already in your mailbox are not retracted. Scroll distance and cursor
settings require a new viewport to change.

# `event_kind`

```elixir
@type event_kind() ::
  :key
  | :text
  | :pointer_move
  | :pointer_button
  | :pointer_scroll
  | :pointer_enter
  | :resize
  | :focus
  | :touch
```

Raw input category. `:text` includes committed text and IME events; enter/focus refer to the window, not an element.

# `normalized_t`

```elixir
@type normalized_t() :: %Emerge.Config.Input{
  cursor: Emerge.Config.Cursor.normalized_t(),
  events: [event_kind()],
  scroll_line_pixels: number()
}
```

Canonical form after nested keyword records have been expanded.

# `options`

```elixir
@type options() :: [
  events: [event_kind()],
  scroll_line_pixels: number(),
  cursor: Emerge.Config.Cursor.t() | Emerge.Config.Cursor.options()
]
```

Typed keyword shorthand accepted in this record's parent field.

# `t`

```elixir
@type t() :: %Emerge.Config.Input{
  cursor: Emerge.Config.Cursor.t() | Emerge.Config.Cursor.options(),
  events: [event_kind()],
  scroll_line_pixels: number()
}
```

# `all_events`

```elixir
@spec all_events() :: [event_kind()]
```

Returns every supported raw input category.

---

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