Graphics Reference
In-Depth Information
application. In this case, it would be impossible for our application to determine if
the event was triggered by a user's action or from the OS. Fortunately, in general
there is no need for our application to be aware of the true triggering origin of an
event.
1.4
Categories of Events
We classify events into three categories: user events, application events, and
GUI/window manager events. In this section, we describe each of these event
category and discuss the application's role in servicing these events.
1.4.1
The User
These are events triggered by the actions a user performs on the input devices.
Notice that input devices include actual hardware devices (e.g., mouse, keyboard)
and/or software-simulated GUI elements (e.g., slider bars, combo boxes). Typi-
cally, a user performs actions for two very different reasons.
Application-specific. These are input actions that are part of the appli-
cation. Clicking and dragging in the application screen area to create a
HeroBall is an example of an action performed on a hardware input de-
vice. Changing the slider bars to control the HeroBall 's velocity is an ex-
ample of an action performed on a software-simulated GUI element. Both
of these actions and the resulting events are application-specific: the appli-
cation (our program) is solely responsible for servicing these events.
General. These are input actions defined by the windowing environment.
For example, a user clicks and drags in the window title-bar area expecting
to move the entire application window. The servicing of these types of
events requires collaboration between our application and the GUI system.
We will discuss the servicing of these types of events in more detail when
explaining events that originate from the GUI system in Section 1.4.3.
Notice that the meaning of a user's action is context-sensitive. It depends on
where the action is performed: click and drag in the application screen area vs.
slider bar vs. application window title-bar area. In any case, the underlying GUI
system is responsible for parsing the context and determining which GUI element
should receive a particular event.
Search WWH ::




Custom Search