user input automatically. However, if you are going to use the View System without any of the higher-level frameworks, it is not difficult to handle user input.
For both mouse and keyboard events, the process is similar:
- The input system packages an input event (such as a mouse-button down event or a key down event) into a request.
- The input system determines which task receives the input event.
- The input system packages the input event into a request targeted at an event receiver in the target task and places it on the event receiver's request queue.
- A request handler eventually dispatches the request to the event receiver.
- The event receiver (together with the View System for mouse events) determines the appropriate target view for the input event and the target calls DispatchEvent to handle the event.
- DispatchEvent turns the event into a call on a member function of the target view.
Notice that the input system (including the event receiver in your task) and the request handler manage the process up to the last step. (