Input · interface

InputOptions

Explained in Moving things.

interface InputOptions
import type { InputOptions } from '@driftengine/core';

Properties

NameTypeDescription
sourcesreadonlyoptionalPartial<Record<InputSourceName, boolean>>Turn a device off. Absent means on.
More

A disabled source is inert, not absent: its state stops updating, it never takes the prompts, and — for the gamepad — the poll stops outright, so an application that does not want controllers pays for no snapshot at all.

autoPollreadonlyoptionalbooleanWhether to poll the gamepad on an animation frame of this source's own. Defaults to true.
More

True is what makes support seamless: a consumer that wired nothing still gets a working controller. Pass false and call poll() where you want the sample taken — which is what a recorded replay needs, since a sample pinned to the fixed tick is reproducible and one taken on a frame callback is not.

deadzonereadonlyoptionalnumberHow far a stick travels before it is moving. See DEFAULT_DEADZONE.