background image
C H A P T E R 9
Using the Recognition System
Double Taps" beginning on page 10-41. See also "ViewGestureScript" (page 8-71)
in Newton Programmer's Reference.
Combining View Flags
Generally, you must combine multiple view flags to produce useful recognition
behavior. For example, most views that accept user input set the
to enable pen input and the
flag to enable recognition of
standard gestures such scrubbing and inserting spaces.
Except where noted otherwise, the NewtonScript "plus" operator (+) is used to
combine view flags, as in the following code fragment.
myViewTemplate :=
// recognize taps, gestures, and shapes
viewFlags: vClickable+vGesturesAllowed+vShapesAllowed,
Most combinations of view flags include the
If you do not set the
flag, the view does not accept
pen input at all.
Sometimes a particular combination of view flags produces results that seem
incorrect. For example, you might be surprised to discover that a view setting only
the flags
can occasionally recognize numeric
values. (The
flag enables the recognition of single text
characters by the cursive recognizer.) This behavior is caused by the presence of
the symbols dictionary in the set of dictionaries available to the view. The symbols
dictionary includes alphabetic characters, numerals and some punctuation marks.
Most view flags enable this dictionary to support the correction of single letters or
numerals by overwriting. As a side effect, it becomes possible to recognize
extraneous characters or numerals in fields that ostensibly should not support such
input. This behavior is rarely a problem, however, because the recognition system
is designed to show a strong preference for "appropriate" interpretations of input as
defined by the view flags set for the view.
Although you might expect that the presence of the symbols dictionary would
allow a view setting only the flags
to return
alphabetic characters, this behavior is quite difficult to produce. Views that set the
flag show a much stronger preference for single-digit
numbers than single alphabetic characters. However, letters that do not look similar
to numeric values--for example, the letter W--may produce this particular form of
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна