Name
hw_GetEventHandler -- get information about event handler (V6.1)
Synopsis
int func = hw_GetEventHandler(STRPTR name, struct hwTagList *tags);
Function
This function can be used to obtain information about an event handler registered using hw_RegisterEventHandler() or hw_RegisterEventHandlerEx(). Precisely, hw_GetEventHandler() can be used to get the reference to the user function and data associated with the event handler by calling Hollywood's InstallEventHandler() function.

If the script currently doesn't listen to the event handler, i.e. the script didn't install a callback for this event using InstallEventHandler(), hw_GetEventHandler() will return -1. Otherwise, a reference value is returned which can be used to obtain the callback function from the Lua registry.

Additionally, you can pass a tag list containing the following tags:

HWGEHTAG_USERDATA:
Set the pData of this tag to a pointer to an int and hw_GetEventHandler() will store the reference to the user data associated with this event handler in this pointer. If there is no user data associated with the event handler, hw_GetEventHandler() will write -1 to the pointer.

Designer compatibility
Unsupported

Inputs
name
name of the event type; must be identical to the name passed tohw_RegisterEventHandler() or hw_RegisterEventHandlerEx()
tags
tag list containing further options or NULL
Results
func
reference to user callback function for this event handler or -1

Show TOC