Input: 1 Input Flow

Up: GEOS SDK TechDocs | Up | Down | Prev: Input | Next: 2 Mouse Input

User input must flow in an orderly way from the user's device to the proper GEOS object. In a multithreaded environment, just determining the appropriate input recipient can be a monumental task.

GEOS uses several layers of indirection to process user input and to distribute it to its proper destination so applications don't have to. The scheme used not only isolates applications from dealing with devices directly, but it provides convenient and easy ways to control input flow, both within an application and throughout the entire system.

The figure below shows the flow of input from the user's device to its destination. User input is managed primarily by device drivers acting in concert with the UI, and several threads are involved in the input flow. For example, the kernel provides a thread solely for input management that has a high priority; this insures that the pointer image always moves immediately with the mouse.

Input is registered by a device such as a keyboard, stylus, or mouse. The device sends signals to GEOS device drivers, which take the signals and translate them into raw input messages the UI understands. These raw messages are translated by the UI's Input Manager, which refines the events even further. The Input Manager then sends the events on to the topmost UI object in the system, the GenSystem object.

The GenSystem examines the events and their contexts and determines which window or application should receive them. Typically, events you will be interested in will flow from the GenSystem through your GenApplication object, its GenPrimary window, and finally through the appropriate GenView or GenDisplay. These window objects will pass the event on to a visible tree (through a VisContent), which will handle the events.

It is highly unlikely you will ever need to know anything about an input event before it gets to your GenApplication object. Typically, you will only handle mouse, pen, or Keyboard events in custom visible objects and can ignore them in all other cases.

Input events take the form of standard GEOS messages. These messages are defined by the UI but are actually part of MetaClass (they are allocated in MetaClass and exported to the UI). The reference entries for these events can therefore be found under MetaClass

Input events give information about the type of event (e.g., a mouse event), the action taking place (e.g., the right mouse button was pressed), and additional information (e.g., the location of the mouse at the time). Each device has its own set of events--for example, keyboard presses induce MSG_META_KBD_CHAR , and mouse moves induce MSG_META_MOUSE_PTR .


Up: GEOS SDK TechDocs | Up | Down | Prev: Input | Next: 2 Mouse Input