Dispatch the correct event.