The Keyboard class is used to build an interface that can be controlled by a user with a standard keyboard. You can use the methods and properties of the Keyboard class without using a constructor. The properties of the Keyboard class are constants representing the keys that are most commonly used to control games.
See also:
Static variables
staticinlineread onlyALTERNATE:Int = 18
Constant associated with the key code value for the Alternate (Option) key (18).
staticinlineread onlyBACKQUOTE:Int = 192
Constant associated with the key code value for the ` key(192).
staticinlineread onlyBACKSLASH:Int = 220
Constant associated with the key code value for the \ key(220).
staticinlineread onlyBACKSPACE:Int = 8
Constant associated with the key code value for the Backspace key(8).
staticinlineread onlyCAPS_LOCK:Int = 20
Constant associated with the key code value for the Caps Lock key(20).
staticinlineread onlyCOMMAND:Int = 15
Constant associated with the Mac command key (15). This constant is currently only used for setting menu key equivalents.
staticinlineread onlyCONTROL:Int = 17
Constant associated with the key code value for the Control key(17).
staticinlineread onlyDELETE:Int = 46
Constant associated with the key code value for the Delete key(46).
staticinlineread onlyDOWN:Int = 40
Constant associated with the key code value for the Down Arrow key(40).
staticinlineread onlyENTER:Int = 13
Constant associated with the key code value for the Enter key(13).
staticinlineread onlyEQUAL:Int = 187
Constant associated with the key code value for the:Int = key(187).
staticinlineread onlyESCAPE:Int = 27
Constant associated with the key code value for the Escape key(27).
staticinlineread onlyINSERT:Int = 45
Constant associated with the key code value for the Insert key(45).
staticinlineread onlyLEFT:Int = 37
Constant associated with the key code value for the Left Arrow key(37).
staticinlineread onlyLEFTBRACKET:Int = 219
Constant associated with the key code value for the [ key(219).
staticinlineread onlyNUMBER_0:Int = 48
Constant associated with the key code value for the 0 key(48).
staticinlineread onlyNUMBER_1:Int = 49
Constant associated with the key code value for the 1 key(49).
staticinlineread onlyNUMBER_2:Int = 50
Constant associated with the key code value for the 2 key(50).
staticinlineread onlyNUMBER_3:Int = 51
Constant associated with the key code value for the 3 key(51).
staticinlineread onlyNUMBER_4:Int = 52
Constant associated with the key code value for the 4 key(52).
staticinlineread onlyNUMBER_5:Int = 53
Constant associated with the key code value for the 5 key(53).
staticinlineread onlyNUMBER_6:Int = 54
Constant associated with the key code value for the 6 key(54).
staticinlineread onlyNUMBER_7:Int = 55
Constant associated with the key code value for the 7 key(55).
staticinlineread onlyNUMBER_8:Int = 56
Constant associated with the key code value for the 8 key(56).
staticinlineread onlyNUMBER_9:Int = 57
Constant associated with the key code value for the 9 key(57).
staticinlineread onlyNUMPAD:Int = 21
Constant associated with the pseudo-key code for the the number pad(21). Use to set numpad modifier on key equivalents
staticinlineread onlyNUMPAD_0:Int = 96
Constant associated with the key code value for the number 0 key on the number pad(96).
staticinlineread onlyNUMPAD_1:Int = 97
Constant associated with the key code value for the number 1 key on the number pad(97).
staticinlineread onlyNUMPAD_2:Int = 98
Constant associated with the key code value for the number 2 key on the number pad(98).
staticinlineread onlyNUMPAD_3:Int = 99
Constant associated with the key code value for the number 3 key on the number pad(99).
staticinlineread onlyNUMPAD_4:Int = 100
Constant associated with the key code value for the number 4 key on the number pad(100).
staticinlineread onlyNUMPAD_5:Int = 101
Constant associated with the key code value for the number 5 key on the number pad(101).
staticinlineread onlyNUMPAD_6:Int = 102
Constant associated with the key code value for the number 6 key on the number pad(102).
staticinlineread onlyNUMPAD_7:Int = 103
Constant associated with the key code value for the number 7 key on the number pad(103).
staticinlineread onlyNUMPAD_8:Int = 104
Constant associated with the key code value for the number 8 key on the number pad(104).
staticinlineread onlyNUMPAD_9:Int = 105
Constant associated with the key code value for the number 9 key on the number pad(105).
staticinlineread onlyNUMPAD_ADD:Int = 107
Constant associated with the key code value for the addition key on the number pad(107).
staticinlineread onlyNUMPAD_DECIMAL:Int = 110
Constant associated with the key code value for the decimal key on the number pad(110).
staticinlineread onlyNUMPAD_DIVIDE:Int = 111
Constant associated with the key code value for the division key on the number pad(111).
staticinlineread onlyNUMPAD_ENTER:Int = 108
Constant associated with the key code value for the Enter key on the number pad(108).
staticinlineread onlyNUMPAD_MULTIPLY:Int = 106
Constant associated with the key code value for the multiplication key on the number pad(106).
staticinlineread onlyNUMPAD_SUBTRACT:Int = 109
Constant associated with the key code value for the subtraction key on the number pad(109).
staticinlineread onlyPAGE_DOWN:Int = 34
Constant associated with the key code value for the Page Down key(34).
staticinlineread onlyPAGE_UP:Int = 33
Constant associated with the key code value for the Page Up key(33).
staticinlineread onlyPERIOD:Int = 190
Constant associated with the key code value for the . key(190).
staticinlineread onlyRIGHT:Int = 39
Constant associated with the key code value for the Right Arrow key(39).
staticinlineread onlyRIGHTBRACKET:Int = 221
Constant associated with the key code value for the ] key(221).
staticinlineread onlySEMICOLON:Int = 186
Constant associated with the key code value for the ; key(186).
staticinlineread onlySHIFT:Int = 16
Constant associated with the key code value for the Shift key(16).
staticinlineread onlySPACE:Int = 32
Constant associated with the key code value for the Spacebar(32).
staticinlineread onlyUP:Int = 38
Constant associated with the key code value for the Up Arrow key(38).
Static methods
staticisAccessible():Bool
Specifies whether the last key pressed is accessible by other SWF files. By default, security restrictions prevent code from a SWF file in one domain from accessing a keystroke generated from a SWF file in another domain.
Returns:
The value true
if the last key pressed can be
accessed. If access is not permitted, this method returns
false
.