Input: 2 Mouse Input

Up: GEOS SDK TechDocs | Up | Down | Prev: 1 Input Flow | Next: 3 Keyboard Input

GEOS is built around the user's use of a mouse for most input. Although the system has extensive keyboard navigation capabilities, the mouse is still the preferred input tool for a GUI. Therefore, most applications will in some way accept and handle mouse input directly.

Typically, you will handle mouse input if you are using visible objects ( VisClass , etc.) that will react to the mouse. If you are using only generic objects in your application, you will not need to handle mouse events.

Mouse input comes in the form of pointer and Button events. Each event describes the mouse's location, the type of event (move, button press, etc.), whether any buttons on the mouse are pressed, and whether any modifier keys on the keyboard are pressed.

Objects can "grab" the mouse exclusive, taking all mouse events for themselves. This is useful when one object needs to get all mouse input for a period of time; when it no longer needs all mouse input, it releases the exclusive. Mouse events are dispatched directly to whichever object has the "active grab" (the exclusive).

If no object has the active grab, the event will be passed to the application under the pointer. The application will pass the event to the window or GenView under the pointer, and the window or view will pass it to its content. If the view displays a visible tree, the event will eventually reach the visible object under the mouse pointer, where it should be handled. Thus, the object under the mouse pointer is said to have the "implied grab."

The default behavior of the VisContent (passing the event to its first child with the appropriate bounds) is adequate for most input needs. If you are using large documents or visible layers, you will have to subclass the VisContent to handle these special cases.


Up: GEOS SDK TechDocs | Up | Down | Prev: 1 Input Flow | Next: 3 Keyboard Input