Graphics Reference
In-Depth Information
The answer to the first question is application-dependent, but the answer to the
second is more generic. For instance, we can make the simple observation that
among all locations on the screen, the one most rapidly reachable by the cursor
is the cursor's current location (see Figure 21.2). The next most reachable points
are the four corners of the screen, because of the convention that the pen cursor
never moves outside the screen: A motion to any point in the infinite quadrant
associated to a corner requires no real precision in either the horizontal or vertical
dimension. The four edge strips are similarly easy to reach, although they require
some control in either the horizontal or vertical dimension.
One consequence of the “point beneath the cursor is easy to reach” idea is that
pie menus (menus that appear beneath the cursor, in which a drag into one of
several sectors selects an option) are extremely easy to access (see Figure 21.3).
Adjusting the sector sizes makes selecting common operations even easier, and
muscle memory lets advanced users select from such menus without even looking
at them.
Figure 21.2: The quadrants
(green) associated to corners are
easy targets for cursor motion;
the
strips
(blue)
associated
to
screen edges are also good.
A consequence of the “corners and edges of the screen are good targets” idea is
that placing menus for all programs at the top of the screen may make interaction
more efficient than locating them at the tops of individual windows. Of course, the
initial interaction with a previously inactive program may be slower: The program
must first be selected to activate it, and thus place its menu at the top of the screen.
By contrast, in the “menus in windows” model, the program selection and menu
selection may be combined into a single action.
By the way, generalizations of Fitts' Law give us estimates of the difficulty
of reaching two-dimensional targets [GKB07], and of steering through a narrow
(possibly winding) channel to a goal [AZ97], a result that's been discovered inde-
pendently in several disciplines [Ras60, Dru71]. Fitts' Law also seems to extend
quite naturally to multitouch devices [FWSB07, MSY07]. These extensions, too,
can be used to guide your designs.
Figure 21.3: A pie menu. Dif-
ferent
sector
sizes
make
some
options
easier
to
choose
than
others.
21.2.2 Interaction Event Handling
You've written programs in which clicking a button on the interface, or selecting
a menu item, caused something to happen. The 2D test-bed program described
in Chapter 4 contains examples of such interaction. The method used there is
overriding methods. There's a Button class with a buttonPressed method that
does nothing. We create a new class in which buttonPressed is overridden to do
something useful for us. The system watches for events like a button press, and
when they occur it invokes the appropriate method.
There are alternative approaches. In some object-oriented programming
approaches, objects can respond to messages sent to them, rather than having
methods that can be invoked. When a button is created in such a system, it's told
what message to send and where to send it, in response to a button press.
In some non-object-oriented systems, you pass a function pointer to a proce-
dure that creates a button. When the button is pressed, the function is called.
These are all just minor variations on a single theme. At a lower level, the
fact that the mouse button was pressed at all must be noticed and handled. There
are basically two approaches. In one, the button press generates an interrupt, and
an interrupt handler is invoked to determine the location of the cursor and then
dispatch the event to the appropriate button, for instance. In another, the button
press enqueues an event on an event queue, which an interaction loop is constantly
 
 
Search WWH ::




Custom Search