Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Event delegation flexibility

The event delegation model provides a great deal of flexibility. You may handle the event before and/or after delegating the event to an active widget. This provides the ability to do additional processing behind the scenes, and even to override or customize the behavior of a widget.

Key event delegation sequence

The sequence of a key press event is illustrated below.

  1. The process starts with the user pressing a key on the device.
  2. The OEM software sends the key events to Brew MP.
  3. Brew MP sends the event to the top-visible applet via the applet's IAPPLET_HandleEvent() method.
  4. The applet can optionally handle that event first.

    If processed, the event handler returns TRUE. If the event is not handled the handler returns FALSE.

  5. The event can be passed to Root Container's IWidget. The event will be routed to all applicable containers and widgets for handling. IWidget_HandleEvent() will return TRUE if the event was handled by the UI, FALSE otherwise.
  6. The applet can optionally handle the event again. IAPPLET_HandleEvent() must return TRUE if the applet (or any method to which the event handling was delegated) handled the event.

    The timely handling of events is crucial to the stability of the system. Failure to return from IAPPLET_HandleEvent() methods can result in watchdog timeouts.

For more event handling information, see the Application Management Technology Guide for Developers in http://developer.brewmp.com/resources on the Brew MP website.