Keyboard events

The ability to handle keyboard events, unlike the ability to handle mouse events, is not unique to the View System. Any object can handle keyboard events. However, it is common for a view to need to handle keyboard events.

A keyboard event is a packet of data that the keyboard device creates. You can't examine the internal structure of a keyboard event. Instead, the Input System turns a keyboard event into a call on one of your view's member functions.

Figure 26 illustrates how the input system converts an key-down event into a request for your task's event receiver.


In Figure 27, the request handler dispatches the event to the event receiver, which maintains a list of objects that have registered as targets for keyboard events. The event receiver distributes the event by serially calling each registered target's DispatchEvent member function until one of the targets handles
the event.


Figure 27 illustrates that, within each target, DispatchEvent calls the target's KeyDown member function. By convention, if the target's KeyDown member function returns True, the event receiver considers the event handled and returns. Otherwise, the event receiver calls the next target's KeyDown member function.


[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