background image
C H A P T E R 1 0
Recognition: Advanced Topics
Using Advanced Topics in Recognition
Customized Processing of Double Taps
To process double taps reliably, your view's
method can
test for the presence of the
gesture. The gesture recognizer
measures time between pen events reliably even when the main NewtonScript
thread is busy.
The recognition system considers a second tap to be part of a double tap when it
occurs within a specified amount of time and distance relative to the first tap.
The second tap must be within 6 pixels of the first to be considered part of a double
tap. Any stroke longer than 6 pixels is not recognized as a tap (or as the second
tap). Measurement of the distance between taps is based on the midpoint of the
start and end points of the stroke.
The amount of time that determines whether a second tap is considered part of a
double tap is specified by the value of the
slot in the
system's user configuration data. This value ranges between 15 and 60 ticks, with a
default value of 45 ticks. The user sets the value of this slot by moving the
"Transform my handwriting" slider in the Fine Tuning slip. The Fine Tuning slip is
available from the picker displayed by the Options button in the Handwriting
Recognition preferences slip.
method is called only if the view does not handle the
gesture automatically. Your
method should return the
to avoid passing the gesture unit to other
methods, such as those supplied by views in the
chain. If you do want to
pass the gesture unit to other views, your method should return the value
Changing User Preferences for Recognition
When you must make system-wide changes in recognition behavior, you can set
the values of slots in the system's user configuration data to do so. However, in
most cases it is more appropriate to change the behavior of individual views, rather
than system-wide settings. For information on using
frames to specify
the recognition behavior of individual views, see "Using recConfig Frames"
beginning on page 10-8.
Take the following steps to change recognition settings used by all views:
1. Call the
function to set the values of one or more slots in the
system's user configuration data. For a complete listing of the recognition-
related slots, see "System-Wide Settings" (page 8-2) in Newton Programmer's
2. Call the
function to cause the system to use the
new settings.
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна