Skip to content

@modoki/engine / index / InputSource

Interface: InputSource

Input

name

readonly name: string


attach()

attach(): void

Begin listening / polling. Idempotent — safe to call when already attached.

Returns

void


detach()

detach(): void

Stop listening and drop any latched state. Idempotent.

Returns

void


reset()?

optional reset(): void

Drop latched state WITHOUT detaching. Called when the input gate closes, so a key held at that moment can't keep driving the game. Optional; a stateless source (one that derives everything in sample) needs none.

Returns

void


sample()

sample(out): void

Merge this source's contribution into out (OR held flags, add axes, set lastDevice on activity). Never clears another source's contribution.

Parameters

out

InputFrame

Returns

void

Built with Modoki.