Overview: 5.4 The GEOS User Interface: Input

Up: GEOS SDK TechDocs | Up | Prev: 5.3 Windows and Window Management | Next: 5.5 Menus and Dialog Boxes

GEOS has an input manager that tracks the mouse, gets keyboard input, and passes the input events on to the proper windows and objects on the screen. The input manager is part of the UI.

The UI keeps track of three different active objects in the system: the Focus, the Target, and the Model. The focus is the active object that should receive all keyboard input. The target is the currently selected object with which the user can interact. The model represents a non-visible "selection" that can be maintained by the application. These three active objects can be accessed directly by other objects (e.g. menu items); for example, a "change color" menu item may want to work on whatever object is currently active--it would want to change the color of the target object, and by contacting the target directly, it does not have to know what object is the target.

Any object in the system can grab mouse or keyboard events. When an object has been granted a mouse grab or keyboard grab, it will receive the events until it relinquishes the grab. This fact is most useful when dealing with visible object trees inside a View (see GenView, below)--generic objects handle input automatically (including the Text objects).

Applications may or may not need to handle input directly; complex applications likely will want to filter certain input or handle special cases. Simple applications or utilities will probably not have to deal with input (keyboard or mouse events) directly at all.


Up: GEOS SDK TechDocs | Up | Prev: 5.3 Windows and Window Management | Next: 5.5 Menus and Dialog Boxes