# `Atui.Input`
[🔗](https://github.com/iboard/atui/blob/v0.3.0/lib/atui/input.ex#L1)

Reads the terminal and sends decoded keys to a target process.

Two processes are involved. A *pump* sits blocked in a read on stdin — it can
do nothing else, which is exactly why it is on its own. A *decoder* collects
those bytes, runs them through `Atui.Key`, and forwards `{:atui_key, key}`
messages to the runtime.

The decoder's receive timeout is what makes a bare ESC usable: if no further
byte follows within `esc_timeout` the pending buffer is flushed as `:esc`
rather than waiting forever for an arrow key that is not coming.

# `start_link`

Starts the decoder (and its pump), linked to the caller.

Options:

  * `:read` — 0-arity function returning bytes, `:eof` or `{:error, term}`.
    Defaults to a blocking one-byte read of stdin; override it in tests.
  * `:esc_timeout` — ms to wait before a lone ESC is reported (default 40)

---

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