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).
Type Parameters
Section titled “Type Parameters”TAction
Section titled “TAction”TAction extends string
Properties
Section titled “Properties”dispose
Section titled “dispose”dispose: () =>
void
Defined in: src/modules/input/event-input.ts:23
Unsubscribes, drops every handler, and disposes every provider.
Returns
Section titled “Returns”void
subscribe
Section titled “subscribe”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.
Parameters
Section titled “Parameters”handler
Section titled “handler”(event) => void
Returns
Section titled “Returns”() => void
unsubscribe
Section titled “unsubscribe”unsubscribe: () =>
void
Defined in: src/modules/input/event-input.ts:32
Detaches from every provider without disposing them.
Returns
Section titled “Returns”void