Skip to content

EventInput

Defined in: src/modules/input/event-input.ts:21

Event-driven action dispatch, for consumers with no tick to poll.

Complementary to InputState: same InputMap, same action-level edge semantics, but edges are pushed to subscribers instead of being read back once per tick. A single keypress is a single dispatch, which is what turn-based games want (one keypress = one turn).

TAction extends string

dispose: () => void

Defined in: src/modules/input/event-input.ts:23

Unsubscribes, drops every handler, and disposes every provider.

void


subscribe: (handler) => () => void

Defined in: src/modules/input/event-input.ts:30

Registers a handler and returns a function that removes it. A given function is registered once — subscribing it twice yields one registration. The handler list is snapshotted per event, so a handler added or removed mid-dispatch takes effect from the next event onward.

(event) => void

() => void


unsubscribe: () => void

Defined in: src/modules/input/event-input.ts:32

Detaches from every provider without disposing them.

void