background image
C H A P T E R 8
Text and Ink Input and Display
Using Text
8-33
An array. An element of the array is selected and treated as one of the above
data types. The index of the array element is determined by the value of the
keyArrayIndex
slot (which can be changed dynamically). Note that arrays of
arrays are not allowed here, but an array can include any combination of other
data types.
The Key Result
8
The key result is the value returned when the key is pressed. This value is passed as
a parameter to the
keyPressScript
method. If this method doesn't exist, the
result is converted (if possible) into a sequence of characters that are posted as key
events to the key receiver view.
The key result element can be one of the following types of data:
A string, character constant, or bitmap object, which is simply returned.
An integer, which is returned. Alternately, if the
keyResultsAreKeycodes
slot is set to
true
, the integer is treated as a key code. In this case, the character
corresponding to the specified key code is returned. If you are using keycodes,
make sure to register your keyboard by including the
kKbdUsesKeycodes
view flag.
See Figure 8-14 (page 8-34) for the numeric key codes returned by each of the
keys on a keyboard.
A method. The method is evaluated and its result is treated as if it had been
specified as the result.
An array. An element of the array is selected and treated as one of the above
data types. The index of the array element is determined by the value of the
keyArrayIndex
slot (which can be changed dynamically). Note that arrays of
arrays are not allowed, but an array can include any combination of other
data types.
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна