Adds a global handler function for a specific event type