Doc > API > BaseEventNode

Doc > API > BaseEventNode

BaseEventNode is the base class for all nodes that process events. This inherits from BaseNode.


.onDispatch(outputName: string, callback: DispatchHook)

onDispatch is called when an output triggers an event.

Here is an example usage to listen to events:

Alternatively, you can also have the following arguments from the callback

  • viewer: the viewer displaying the scene.

  • event: the mouse/pointer/keyboard event that originally triggered the event

  • emitter: the domElement the event was triggered from (either the canvas or the document)

  • value: an optional value linked to the event.

Is this doc helpful/not helpful? Is there any information you would like that is not available? Don't hesitate to get in touch with any question or feedback, either by email, on Discord or the forum.