Back to index...

NameTypeDeprecatedSecureDescription
Command.Event.AttachfunctionAttaches an event handler to an event.
Command.Event.DetachfunctionDetaches an event handler from an event. Any parameter can be 'nil', and this is interpreted as a...
Inspect.Event.ListfunctionLists the current event handlers for an event.
Utility.Event.CreatefunctionCreates a custom event. Takes an identifier and an event path as parameters. Called with Create("...

Command.Event.Attach

Attaches an event handler to an event.

Usage:

Command.Event.Attach(event, handler, label)
Command.Event.Attach(event, handler, label, priority)
ParameterTypeDatatypeDescription
eventparametereventGlobalA global event handle, usually pulled out of the "Event." hierarchy.
handlerparameterfunctionA global event handler function. This will be called when the event fires. The first parameter will be the standard global event handle, any other parameters will follow that.
labelparameterstringHuman-readable label used to identify the handler in error reports, performance reports, and for later detaching.
priorityparameternumberPriority of the event handler. Higher numbers trigger first.

Command.Event.Detach

Detaches an event handler from an event. Any parameter can be 'nil', and this is interpreted as a wildcard. If multiple events match the constraints, only one will be detached.

Usage:

Command.Event.Detach(event, handler)
Command.Event.Detach(event, handler, label)
Command.Event.Detach(event, handler, label, priority)
Command.Event.Detach(event, handler, label, priority, owner)
ParameterTypeDatatypeDescription
eventparametereventGlobalA global event handle, usually pulled out of the "Event." hierarchy.
handlerparameterfunction/nilA global event handler function. This will be called when the event fires. The first parameter will be the standard global event handle, any other parameters will follow that.
labelparameterstring/nilHuman-readable label used to identify the handler in error reports, performance reports, and for later detaching.
ownerparameterstring/nilOwner to search for.
priorityparameternumber/nilPriority of the event handler. Higher numbers trigger first.

Inspect.Event.List

Lists the current event handlers for an event.

Usage:

result = Inspect.Event.List(event)
ParameterTypeDatatypeDescription
eventparametereventGlobalA global event handle, usually pulled out of the "Event." hierarchy.
resultresulttableA table of event handlers for this event.
members
handler The handler that will be called when the event fires.
label Label assigned to the event handler at creation.
owner Owner addon for the event handler.
priority Priority for the event handler.

Utility.Event.Create

Creates a custom event. Takes an identifier and an event path as parameters. Called with Create("Identifier", "The.Event.Path") the event table will end up at Event.Identifier.The.Event.Path, and will behave like a standard Rift event table in every way. Undefined behavior if given an identifier or a path that conflicts with a built-in Rift event or an existing addon event.

Usage:

caller, handle = Utility.Event.Create(identifier, event)
ParameterTypeDatatypeDescription
eventparameterstringThe event's name. "." characters will be treated as hierarchy delimeters.
identifierparameterstringThe identifier of the addon creating this event.
callerresultfunctionA function used to trigger the event. Called with any selection of parameters, it will pass those parameters through to properly registered event handlers in order. Any errors caused by those event handlers will be caught and handled.
handleresulttableThe resulting event handle.

Back to index...