Object | +-Key public class Key extends Object
The Key class is a top-level class whose methods and properties you can use without a constructor. Use the methods of the Key class to build an interface that can be controlled by a user with a standard keyboard. The properties of the Key class are constants representing the keys most commonly used to control applications, such as Arrow keys, Page Up, and Page Down.
|
Modifiers |
Property |
Description |
|---|---|---|
|
static |
The key code value for the Backspace key (8). |
|
|
static |
The key code value for the Caps Lock key (20). |
|
|
static |
The key code value for the Control key (17). |
|
|
static |
The key code value for the Delete key (46). |
|
|
static |
The key code value for the Down Arrow key (40). |
|
|
static |
The key code value for the End key (35). |
|
|
static |
The key code value for the Enter key (13).. |
|
|
static |
The key code value for the Escape key (27). |
|
|
static |
The key code value for the Home key (36). |
|
|
static |
The key code value for the Insert key (45). |
|
|
static |
The key code value for the Left Arrow key (37). |
|
|
static |
_listeners:Array [read-only] |
A list of references to all listener objects registered with the Key object. |
|
static |
The key code value for the Page Down key (34). |
|
|
static |
The key code value for the Page Up key (33). |
|
|
static |
The key code value for the Right Arrow key (39). |
|
|
static |
The key code value for the Shift key (16). |
|
|
static |
The key code value for the Spacebar (32). |
|
|
static |
The key code value for the Tab key (9). |
|
|
static |
The key code value for the Up Arrow key (38). |
Properties inherited from class Object
|
constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property) |
|
Event |
Description |
|---|---|
|
onKeyDown = function() {} |
Notified when a key is pressed. |
|
onKeyUp = function() {} |
Notified when a key is released. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
static |
addListener(listener:Object) : Void |
Registers an object to receive onKeyDown and onKeyUp notification. |
|
static |
Returns the ASCII code of the last key pressed or released. |
|
|
static |
Returns the key code value of the last key pressed. |
|
|
static |
Returns true if the key specified in code is pressed; false otherwise. |
|
|
static |
removeListener(listener:Object) : Boolean |
Removes an object previously registered with Key.addListener(). |
Methods inherited from class Object