Repository navigation
API Function defineTrigger
github-actions[bot] edited this page Nov 24, 2026
·
3 revisions
function defineTrigger<P>(name, factory): void;Defined in: src/engine/input/triggers.ts:242
Register a trigger kind that contexts (*.input.json, defineInputContext) and inline
mappings can name: { "action": "jump", "control": "…", "triggers": [{ "game.doubleHold": { "min": 0.3 } }] }.
The name is namespaced, as ids are ("game.doubleHold"), so it never clashes with a built-in
trigger. Registering a name again replaces it, and bindings using it recompile.
defineTrigger<{ min: number }>("game.doubleHold", ({ min }) => {
let held = 0;
return { update: (actuated, dt) => ((held = actuated ? held + dt : 0) >= min ? 2 : actuated ? 1 : 0) };
});P = unknown
string
void
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference