User Guide

327
You can use the key in handlers that perform certain actions when the user presses specific keys
as shortcuts and other forms of interactivity. When used in a primary event handler, the actions
you specify are the first to be executed.
Note: The value of the key isn’t updated if the user presses a key while Lingo is in a repeat loop.
Use the sample movie Keyboard Lingo to test which characters correspond to different keys on
different keyboards.
Examples
The following statements cause the movie to return to the main menu marker when the user
presses the Return key. Because the
keyDownScript property is set to checkKey, the on
prepareMovie
handler makes the on checkKey handler the first event handler executed when a
key is pressed. The
on checkKey handler checks whether the Return key is pressed and if it is,
navigates to the main menu marker.
on prepareMovie
the keyDownScript = "checkKey"
end prepareMovie
on checkKey
if the key = RETURN then go to frame "Main Menu"
end
This on keyDown handler checks whether the last key pressed is the Enter key and if it is, calls the
on addNumbers handler:
on keyDown
if the key = RETURN then addNumbers
end keyDown
See also
commandDown, controlDown, keyCode(), optionDown
keyboardFocusSprite
Syntax
set the keyboardFocusSprite = textSpriteNum
Description
System property; lets the user set the focus for keyboard input (without controlling the cursors
insertion point) on a particular text sprite currently on the screen. This is the equivalent to using
the Tab key when the
AutoTab property of the member is selected.
Setting
keyboardFocusSprite to -1 returns keyboard focus control to the score, and setting it to
0 disables keyboard entry into any editable sprite.
See also
autoTab, editable