Other projects
Kuix Event Processing
Kuix implements a basic event processor that handles all events in applications (user actions, popups, screen refresh, etc.).
The next figure shows the event handling process implemented in Kuix.

For each user action (1), Java ME sends a message to the current canvas. The canvas does not handle the event itself but push it into the event stack (2). This stack is polled regularly by a dedicated worker thread that process events against the FocusManager (3).
The FocusManager applies an internal logic to handle the event (detailed later) (4) and the event can be forwarded to the FrameHandler if an action is registered to the focused widget (5).
Once all events have been processed, the screen is repaint (if needed and only involved widgets).
Hereafter, is the algorithm used by the FocusManager to handle events.
|
a) The FocusManager tries to identify the current focused widget. If it exists and it consumes the message, function returns. b) If no current focused widget, the FocusManager compare the key code with the shortcut list. If a match is found, it identifies and dispatch the event to the corresponding widget. c) otherwise, the FocusManager applies the default action : interface navigation. |

