Key.CAPSLOCK
Availability
Flash Player 5.
Usage
Key.CAPSLOCK:Number
Description
Property; constant associated with the key code value for the Caps Lock key (20).
Example
The following example creates a new listener object and defines a function for
last line uses
addListener()
notification from the key down event.
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.CAPSLOCK)) {
trace("you pressed the Caps Lock key.");
trace("\tCaps Lock == "+Key.isToggled(Key.CAPSLOCK));
}
};
Key.addListener(keyListener);
Information displays in the Output panel when you press the Caps Lock key. The Output panel
displays either
true
isToggled method.
346
Chapter 2: ActionScript Language Reference
to register the listener with the Key object so that it can receive
or
, depending on whether the Caps Lock is activated using the
false
. The
onKeyDown
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?