Skip to content

Latest commit

 

History

History
30 lines (15 loc) · 765 Bytes

9.md

File metadata and controls

30 lines (15 loc) · 765 Bytes

Chapter 9: Event Dispatcher

What is the EventDispatch mechanism?

EventDispatch is a mechanism for responding to user events.

The basics:

  • Event listeners encapsulate your event processing code.
  • Event dispatcher notifies listeners of user events.
  • Event objects contain information about the event.

5 types of event listeners.

EventListenerTouch - responds to touch events

EventListenerKeyboard - responds to keyboard events

EventListenerAcceleration - responds to accelerometer events

EventListenMouse - responds to mouse events

EventListenerCustom - responds to custom events

Registering event with the dispatcher

Removing events from the dispatcher