Vizard 8 » Reference » Vizconnect » Advanced GUI » Events
8.1

Events

Use the Events tab to define custom events that are triggered by input signals. These events are automatically registered with Vizard and handled within the Vizard code. Defining events via vizconnect helps to maintain the abstraction between software and hardware. The Vizard application only needs to know that an event has occurred, not what particular input signal has triggered the event. The input signal to event mapping is contained within the vizconnect file. Depending on the vizconnect file used, the same event callback function could be triggered by a wand button, mouse button, keypress etc.

Event Setup

  1. Go to the Events tab in Vizconnect, add an event, and give it a name (e.g. MY_EVENT)
  2. Press the Mappings button to define the input signal that triggers the event
  3. In the script, register a callback function for the event using the following code:
viz.callback(viz.getEventID('MY_EVENT'), myFunction)

Event API

The following command returns a handle to the wrapped event using the name defined in the configuration:

Command Description

vizconnect.getEvent(name)

Returns a handle to the wrapped event.

In addition to the methods listed below, wrapped object methods from the <node> class can be called on the wrapped input:

Method Description
<WrappedEvent>.getEnabled()

Gets the enabled state of the event.

<WrappedEvent>.setEnabled(state)

Sets the enabled state of the event.

State: can be viz.ON, viz.OFF, or viz.TOGGLE