Name
Key.isToggled( ) Method — check whether the Caps Lock, Num Lock, or Scroll Lock keys are activated
Availability
Flash 5
Synopsis
Key.isToggled(keycode)
Arguments
- keycode
An integer keycode, usually the keycode of the Caps Lock key (20), Num Lock key (144), or Scroll Lock key (145). May also be the key constant
Key.CapsLock.
Returns
A Boolean indicating whether the key specified by
keycode is on (true) or
off (false).
Description
The isToggled( ) method detects the state of the
special Caps Lock, Num Lock, or
Scroll Lock keys. Unlike other
keys, these keys have an “on” state and an
“off” state indicating whether or not the feature they
represent is active. The return of isToggled( )
tells us if the key’s feature is in effect or not. (Though
isToggled( ) actually works for any keycode, its
return value is useful only for special keys that support a toggle
feature. To detect the state of other keys, use isDown(
), getCode( ), or getAscii(
).)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access