Event Listener

Navigation:  Widget Designer > Devices >

Event Listener

prev main next

Navigation:  Widget Designer > Devices >

Event Listener

prev main next

Loading...

The Configuration dialog also provides Event Listeners which offer a simple way of listening to triggers from the connected devices.
Very similar to the Action Script node, you are able to define a trigger for specific actions or events from the respective device. The number and type of events depend on the device and range from simple value changes to shutdown events.
Note that this is only available in the licensed Widget Designer edition, not the Free version.

The Event Listener shows only events from devices that were added to the Configuration dialog before. The following devices offer events:
Barco devices
Blackmagic Atem
Blackmagic VideoHub
Christie devices
Fader Extension Events
Group Event Listener
Jog/Shuttle Events
Lightware Events
Phidgets devices
PowerPoint Events
Projector
TCP Client Events
UDP Client Events
UDP Server&Client Events
 

How to Add an Event Listener

To add an Event Listener, open the Devices menu and select "Event Listener > Create Event Listener". This will open the Configuration dialog. Alternatively, you can add a new Event Listener in the Configuration dialog with the "+" button when the dialog is already open.

How to Configure an Event Listener

On the right side, you can enter the event's name, device, event and script. Click the "Apply" button to save any changes done in the Configuration dialog. The shortcut [Ctrl + Enter] can also be used to apply changes.

WD_EventListener

The Type informs you about the type of device or connection.

The Groups lists the groups to which this device belongs.

The Name is the unique identifier for this Event Listener. It helps to keep track what you have programmed where. the general rules for naming objects apply here as well: only letters, numbers and underscores are allowed; the first symbol must be a letter.

The Id offers an alternative way to address the Event Listener when scripting. Examples are shown below.

The "Enable" check box is selected by default. Uncheck it to stop the Event Listener (temporarily). You can also program this, e.g. to a CustomScript button, as described further down.

The "Device" drop-down lists all devices that were added to the Configuration and offer events. Choose one and the "Event" drop-down will offer all events referring to that device.

The "Event" specifies the trigger, i.e. when to execute the following script. Select one from the drop-down list.

The scripting field can be filled with commands that should be executed when the event happens. You could for example write: Label1.Text = "yourMessage"

Some events offer "Parameters". When choosing the event "LayoutApplied" from the device Christie_Terra1 for example, you will see that it lists some parameter names on top of the scripting field, such as "layout (String)" and "displayArray (String)". This means that this specific event provides these values as local variables to be used in the script. For instance, you can write "Label1.Text = layout" and the Label will instantly show the name of the Layout which was just applied, whenever this occurs.

How to Use Event Listeners in Regular Scripting

As soon as an Event Listener is created, it can be addressed via scripting to en- and disable it.

EventListener1.Enable
This enables the Event Listener with the name "EventListener1", i.e. the "Enable" check box in the Configuration dialog is checked.

EventListener1.Disable
This disables the Event Listener with the name "EventListener1", i.e. the "Enable" check box in the Configuration dialog is not checked.

DebugMessage(EventListener1.IsEnabled)
or
v_bool = EventListener1.IsEnabled
This returns "true" if the Event Listener with the name "EventListener1" is enabled, i.e. the "Enable" check box in the Configuration dialog is checked and "false" if it is not.

As an alternative to explicitly naming the Event Listener, the "Project" object can be used. Choose "Event Listener" and address it by entering its ID. Script Assist then offers you the same list of members. This is the alternative for the first example from above:
Project.EventListener(1).Enable

This allows you to automate actions that should be performed on many Event Listeners at once because you can substitute the ID with a dynamic variable as done in for-loops for example:
For i = 1 to 10 {

 Project.EventListener(i).Enable

}

The chapter "Project and Context Member" shows more examples with for-loops and if-clauses; of course, normal variables can also be used.