Skip to content

Custom Events

A custom event is generated by certain devices in response to query commands or unique device events. For instance, G4 touch panels generate custom events in response to button query commands or mouse clicks.

An example channel event is shown below:

1
2
3
4
CUSTOM_EVENT[DEVICE,ID,TYPE] or CUSTOM_EVENT[DEVCHAN,EVENTID]
{

}

The EVENTID is specific to each device. For instance, the EVENTID sent in response to a button text query command for G4 touch panels is 1001. For more information on EVENTID values and the values of the custom event for each EVENTID, see the programming section of the device manual with which you are working.

The following table lists the information contained in Custom events:

Property Name Type Description
Custom.Device DEV Device
Custom.Device.Number INTEGER Device number
Custom.Device.Port INTEGER Device port
Custom.Device.System INTEGER System number
Custom.ID INTEGER The ID of the custom event as defined by the device
Custom.Type INTEGER The TYPE of the custom event as defined by the device
Custom.Flag INTEGER A flag associated with the event
Custom.Value1 SLONG The first value associated with the event
Custom.Value2 SLONG The second value associated with the event
Custom.Value3 SLONG The third value associated with the event
Custom.Text CHAR[] Text associated with the event
Custom.Encode CHAR[] A string encoded with VARIABLE_TO_STRING encoding for complex data types.
Custom.SourceDev DEV Source device of custom event
Custom.SourceDev.Number INTEGER Source device number
Custom.SourceDev.Port INTEGER Source device port
Custom.SourceDev.System INTEGER Source device system.

If the event handler is specified using an array for DEV, INTEGER, or a DEVCHAN array, GET_LAST can determine which index in the array caused the event to run.

See Also