Content:MirLua/NamedEvents

From Miranda NG
Revision as of 19:05, 12 November 2015 by RMN (talk | contribs)
Jump to navigation Jump to search
Function Description Extended description Settings Example
CreateHookableEvent Creates a hookable event. name
Type: string
Event name.
Result
Type: light userdata
Returns event descriptor if event was created successfully, else nil.
Content:MirLua/NamedEvents/Examples
HookEvent Sets a callback function ("trap") to react to event call. Traps are called one by one in the order they were added to the sequence.

Trap signature: function (wParam, lParam) return 0 end.

Correct result for a trap is 0. When 1 is returned, the following traps in a sequence won't be called.
name
Type: string
Event name.

hook

Type: function
Trap function to be called when event occurs.
Result
Type: light userdata
Returns trap descriptor if trap was created successfully, else nil.
Content:MirLua/NamedEvents/Examples
UnhookEvent Removes "trap" from event call sequence. hEvent
Type: light userdata
Event descriptor received on CreateHookableEvent call.
Result
Type: boolean
Returns true if trap function was removed successfully, else false.
Content:MirLua/NamedEvents/Examples
NotifyEventHooks Calls all "traps" of event call sequence one by one. hEvent
Type: light userdata
Event descriptor received on CreateHookableEvent call.

wParam
lParam

Result
Type: boolean
Returns true if all trap functions were called, else false.
Content:MirLua/NamedEvents/Examples
DestroyHookableEvent Destroys a hookable event. All traps of the call sequence are destroyed as well. If event call wasn't competed, the call sequence gets broken after the current trap function is executed. hEvent
Type: light userdata
Event descriptor received on CreateHookableEvent call.
Result
Type: boolean
Returns true if event was destroyed successfully, else false.
Content:MirLua/NamedEvents/Examples
Documentation

Automatic, localized table for MirLua named event functions test table.