Handling user input

Higher-level document frameworks manage much of the handling of 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:

  1. The input system packages an input event (such as a mouse-button down event or a key down event) into a request.
  2. The input system determines which task receives the input event.
  3. 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.
  4. A request handler eventually dispatches the request to the event receiver.
  5. 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.
  6. 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. ("Requests, request queues, and request handlers" on page 74 describes request handlers in more detail.) With the default behavior, all you have to do to handle input events is provide member functions to handle the function call generated in the last step.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker