Routes input events to the correct handlers based on focus state and hit-testing.
Pure module — takes events and state, returns new state and list of actions. No side effects, no processes. The Runtime calls this to process events.
Event flow:
- Tab/Shift+Tab → focus navigation
- Mouse events → hit-test buffer → resolve target → auto-focus on left click
- Resize events → resize action
Summary
Functions
Create an event manager from an element tree.
Process an input event. Returns {new_state, actions} where actions is a list of side effects for the Runtime to execute.
Update the tree and buffer after a render.
Types
@type state() :: %ElixirOpentui.EventManager{ buffer: ElixirOpentui.Buffer.t() | nil, focus: ElixirOpentui.Focus.t(), tree: ElixirOpentui.Element.t() | nil }
Functions
@spec new(ElixirOpentui.Element.t(), ElixirOpentui.Buffer.t()) :: state()
Create an event manager from an element tree.
@spec process(state(), ElixirOpentui.Input.event()) :: {state(), [term()]}
Process an input event. Returns {new_state, actions} where actions is a list of side effects for the Runtime to execute.
@spec update(state(), ElixirOpentui.Element.t(), ElixirOpentui.Buffer.t()) :: state()
Update the tree and buffer after a render.