Sets a listener for a specific event.
The event to listen for.
The function to call when the event occurs.