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.
Static variables
staticinline read onlyALTERNATE:Int = 18
Constant associated with the key code value for the Alternate(Option) key (18).
staticinline read onlyBACKQUOTE:Int = 192
Constant associated with the key code value for the ` key(192).
staticinline read onlyBACKSLASH:Int = 220
Constant associated with the key code value for the \ key(220).
staticinline read onlyBACKSPACE:Int = 8
Constant associated with the key code value for the Backspace key(8).
staticinline read onlyCAPS_LOCK:Int = 20
Constant associated with the key code value for the Caps Lock key(20).
staticinline read onlyCOMMA:Int = 188
Constant associated with the key code value for the , key(188).
staticinline read onlyCOMMAND:Int = 15
Constant associated with the Mac command key(15). This constant is currently only used for setting menu key equivalents.
staticinline read onlyCONTROL:Int = 17
Constant associated with the key code value for the Control key(17).
staticinline read onlyDELETE:Int = 46
Constant associated with the key code value for the Delete key(46).
staticinline read onlyDOWN:Int = 40
Constant associated with the key code value for the Down Arrow key(40).
staticinline read onlyENTER:Int = 13
Constant associated with the key code value for the Enter key(13).
staticinline read onlyEQUAL:Int = 187
Constant associated with the key code value for the = key(187).
staticinline read onlyESCAPE:Int = 27
Constant associated with the key code value for the Escape key(27).
staticinline read onlyF10:Int = 121
Constant associated with the key code value for the F10 key(121).
staticinline read onlyF11:Int = 122
Constant associated with the key code value for the F11 key(122).
staticinline read onlyF12:Int = 123
Constant associated with the key code value for the F12 key(123).
staticinline read onlyF13:Int = 124
Constant associated with the key code value for the F13 key(124).
staticinline read onlyF14:Int = 125
Constant associated with the key code value for the F14 key(125).
staticinline read onlyF15:Int = 126
Constant associated with the key code value for the F15 key(126).
staticinline read onlyHOME:Int = 36
Constant associated with the key code value for the Home key(36).
staticinline read onlyINSERT:Int = 45
Constant associated with the key code value for the Insert key(45).
staticinline read onlyLEFT:Int = 37
Constant associated with the key code value for the Left Arrow key(37).
staticinline read onlyLEFTBRACKET:Int = 219
Constant associated with the key code value for the [ key(219).
staticinline read onlyMINUS:Int = 189
Constant associated with the key code value for the - key(189).
staticinline read onlyNUMBER_0:Int = 48
Constant associated with the key code value for the 0 key(48).
staticinline read onlyNUMBER_1:Int = 49
Constant associated with the key code value for the 1 key(49).
staticinline read onlyNUMBER_2:Int = 50
Constant associated with the key code value for the 2 key(50).
staticinline read onlyNUMBER_3:Int = 51
Constant associated with the key code value for the 3 key(51).
staticinline read onlyNUMBER_4:Int = 52
Constant associated with the key code value for the 4 key(52).
staticinline read onlyNUMBER_5:Int = 53
Constant associated with the key code value for the 5 key(53).
staticinline read onlyNUMBER_6:Int = 54
Constant associated with the key code value for the 6 key(54).
staticinline read onlyNUMBER_7:Int = 55
Constant associated with the key code value for the 7 key(55).
staticinline read onlyNUMBER_8:Int = 56
Constant associated with the key code value for the 8 key(56).
staticinline read onlyNUMBER_9:Int = 57
Constant associated with the key code value for the 9 key(57).
staticinline read onlyNUMPAD:Int = 21
Constant associated with the pseudo-key code for the the number pad(21). Use to set numpad modifier on key equivalents
staticinline read onlyNUMPAD_0:Int = 96
Constant associated with the key code value for the number 0 key on the number pad(96).
staticinline read onlyNUMPAD_1:Int = 97
Constant associated with the key code value for the number 1 key on the number pad(97).
staticinline read onlyNUMPAD_2:Int = 98
Constant associated with the key code value for the number 2 key on the number pad(98).
staticinline read onlyNUMPAD_3:Int = 99
Constant associated with the key code value for the number 3 key on the number pad(99).
staticinline read onlyNUMPAD_4:Int = 100
Constant associated with the key code value for the number 4 key on the number pad(100).
staticinline read onlyNUMPAD_5:Int = 101
Constant associated with the key code value for the number 5 key on the number pad(101).
staticinline read onlyNUMPAD_6:Int = 102
Constant associated with the key code value for the number 6 key on the number pad(102).
staticinline read onlyNUMPAD_7:Int = 103
Constant associated with the key code value for the number 7 key on the number pad(103).
staticinline read onlyNUMPAD_8:Int = 104
Constant associated with the key code value for the number 8 key on the number pad(104).
staticinline read onlyNUMPAD_9:Int = 105
Constant associated with the key code value for the number 9 key on the number pad(105).
staticinline read onlyNUMPAD_ADD:Int = 107
Constant associated with the key code value for the addition key on the number pad(107).
staticinline read onlyNUMPAD_DECIMAL:Int = 110
Constant associated with the key code value for the decimal key on the number pad(110).
staticinline read onlyNUMPAD_DIVIDE:Int = 111
Constant associated with the key code value for the division key on the number pad(111).
staticinline read onlyNUMPAD_ENTER:Int = 108
Constant associated with the key code value for the Enter key on the number pad(108).
staticinline read onlyNUMPAD_MULTIPLY:Int = 106
Constant associated with the key code value for the multiplication key on the number pad(106).
staticinline read onlyNUMPAD_SUBTRACT:Int = 109
Constant associated with the key code value for the subtraction key on the number pad(109).
staticinline read onlyPAGE_DOWN:Int = 34
Constant associated with the key code value for the Page Down key(34).
staticinline read onlyPAGE_UP:Int = 33
Constant associated with the key code value for the Page Up key(33).
staticinline read onlyPERIOD:Int = 190
Constant associated with the key code value for the . key(190).
staticinline read onlyQUOTE:Int = 222
Constant associated with the key code value for the ' key(222).
staticinline read onlyRIGHT:Int = 39
Constant associated with the key code value for the Right Arrow key(39).
staticinline read onlyRIGHTBRACKET:Int = 221
Constant associated with the key code value for the ] key(221).
staticinline read onlySEMICOLON:Int = 186
Constant associated with the key code value for the ; key(186).
staticinline read onlySHIFT:Int = 16
Constant associated with the key code value for the Shift key(16).
staticinline read onlySLASH:Int = 191
Constant associated with the key code value for the / key(191).
staticinline read onlySPACE:Int = 32
Constant associated with the key code value for the Spacebar(32).
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
.