Events
Keyboard, custom, and window lifecycle events; virtual mouse/touch input uses Helix/Input.
SyncroMesh uses Helix/Event for keyboard, window lifecycle, and custom events. Register listeners with Event.on(name, callback) and dispatch local events with Event.emit(name, payload). Mouse/touch interactions use Helix/Input and element virtual handlers; see the 0.5.0 → 0.6.0 migration guide.
Import #
import * as Event from 'Helix/Event';Custom events #
import * as Event from 'Helix/Event';
Event.on('ui:action', (payload) => {
if (payload.type === 'burst') {
// route to board-specific behavior
}
});
Event.emit('ui:action', { type: 'burst', source: 'button' });Mouse/touch interactions use Helix/Input and element virtual handlers. See /helix-input for ownership, gestures and migration.
Window events #
closed #
Fired when a window close is requested. No event payload.
ready #
Fired after the engine has initialised and the bootstrap script has completed. Also fired after a RELOAD.
preRender #
Fired from the render pipeline when render_begin is reached. This event is coalesced behind a fence: it is only dispatched when the previous preRender callback is idle, and intermediate frames may be skipped.
windowIdnumber - Window id currently rendering.timenumber - Engine time in seconds for this render pass.integrationnumber - Render interpolation alpha supplied by the engine.
Examples #
import * as Input from 'Helix/Input';
await Input.setHandlers(windowId, { onActivate(event) { console.log(event.position, event.world); } });