event.signalΒΆ

nil event.signal ( string event , any ... )

Trigger an event, and execute registered handlers.

This function allows you to execute event handlers for a particular event. It is possible to register and signal any event, even not predefined ones.

-- Somewhere in init...
event.register ("mycustomevent"function (event, a, b)
    print (tostring (event).." triggered with parameters:", a, b)
end)

-- Later in code
local param2 = 12
-- trigger the event handler defined above with the arguments "mycustomevent""param1" and 12.
event.signal ("mycustomevent""param1", param2)
Arguments:

  • event The event to be triggered
  • ... The parameters to be sent to the event handler