Vizard 7 » Command Index » Vizard modules » viz » <viz>.sendEvent
7.6

<viz>.sendEvent

Send an event to all event handlers

<viz>.sendEvent(  
event  
*args  
)  
event
The ID of the event to send.
*args
Variable number of arguments to send along with the event

Remarks

This command will send the specified event to all event handlers that are listening for the event.

Return Value

A combination of the following event action flags:

Flag

Description

viz.EVENT_STOP

Stop the event from being passed on to remaining handlers.

viz.EVENT_PREVENT_DEFAULT

Prevent any default behavior the application would perform for the event.

Example

CUSTOM_EVENT = viz.getEventID('CustomEventName')

viz.sendEvent(CUSTOM_EVENT,arg1,arg2)

def oncustomevent(x,y):
    print('Custom event with args',x,y)

viz.callback(CUSTOM_EVENT,oncustomevent)

See also

<viz>.getCurrentEvent
<viz>.getEventID
<viz>.getEventName
<viz>.getNumHandlers
<viz>.postEvent
<viz>.postFunctionCall
<viz>.setEventAction