Skip to content

API Interface CustomTrigger

github-actions[bot] edited this page Dec 1, 2026 · 3 revisions

Interface: CustomTrigger

Defined in: src/engine/input/triggers.ts:216

One mapping's instance of a custom trigger, made by its factory (each mapping gets its own, so it may keep state in closures).

Properties

pulsed?

readonly pulsed?: boolean;

Defined in: src/engine/input/triggers.ts:228

Read after each update: true when it fired a pulse (each pulse performs the action again, as pulse does).


reads?

readonly reads?: readonly string[];

Defined in: src/engine/input/triggers.ts:220

Actions it reads through others (bare names are of the mapping's set). They're resolved first, as a chord's are.


type?

readonly type?: TriggerType;

Defined in: src/engine/input/triggers.ts:218

Explicit (default), implicit or blocker; a spec's type overrides it.

Methods

update()

update(
   actuated, 
   dt, 
   others
): boolean | TriggerStateValue;

Defined in: src/engine/input/triggers.ts:226

One frame: actuated is whether the mapping's value is actuated now, dt the frame's seconds. Return a TriggerState (0 none, 1 ongoing, 2 triggered), or true / false for triggered / none.

Parameters

actuated

boolean

dt

number

others

TriggerWorld

Returns

boolean | TriggerStateValue

Clone this wiki locally