Implement event dispatching.