User Guide

Key 683
Returns
Boolean - The value true if the key specified in keycode is pressed; false otherwise.
Example
The following script lets the user control a movie clip's (
car_mc) location:
car_mc.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT)) {
this._x += 10;
} else if (Key.isDown(Key.LEFT)) {
this._x -= 10;
}
};
isToggled (Key.isToggled method)
public static isToggled(code:Number) : Boolean
Returns true if the Caps Lock or Num Lock key is activated (toggled to an active state);
false otherwise. Although the term toggled usually means that something is switched
between two options, the method Key.isToggled() will only return
true if the key is toggled
to an active state. On the Macintosh, the key code values for the Caps Lock and Num Lock
keys are identical.
A Flash application can only monitor keyboard events that occur within its focus. A Flash
application cannot detect keyboard events in another application.
Availability: ActionScript 1.0; Flash Player 5
Parameters
code:Number - The key code for the Caps Lock key (20) or the Num Lock key (144).
Returns
Boolean - The value true if the Caps Lock or Num Lock key is activated (toggled to an active
state);
false otherwise.