Packageflash.ui
Classpublic final class Keyboard
InheritanceKeyboard Inheritance Object

Language Version : ActionScript 3.0
Player Version : Flash Player 9

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. <Updated Mar. 20, 2008 - added "AIR Only" icons for constants that are only available in Adobe AIR>

See also

Capturing keyboard input


Public Properties
 PropertyDefined By
  capsLock : Boolean
[static] [read-only] Specifies whether the Caps Lock key is activated (true) or not (false).
Keyboard
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  numLock : Boolean
[static] [read-only] Specifies whether the Num Lock key is activated (true) or not (false).
Keyboard
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
 Inherited
Indicates whether an object has a specified property defined.
Object
  
[static] Specifies whether the last key pressed is accessible by other SWF files.
Keyboard
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined By
  AIR-onlyA : uint = 65
[static] Constant associated with the key code value for the A key (65).
Keyboard
  AIR-onlyALTERNATE : uint = 18
[static] Constant associated with the key code value for the Alternate (Option) key (18).
Keyboard
  AIR-onlyB : uint = 66
[static] Constant associated with the key code value for the B key (66).
Keyboard
  AIR-onlyBACKQUOTE : uint = 192
[static] Constant associated with the key code value for the ` key (192).
Keyboard
  AIR-onlyBACKSLASH : uint = 220
[static] Constant associated with the key code value for the \ key (220).
Keyboard
  BACKSPACE : uint = 8
[static] Constant associated with the key code value for the Backspace key (8).
Keyboard
  AIR-onlyC : uint = 67
[static] Constant associated with the key code value for the C key (67).
Keyboard
  CAPS_LOCK : uint = 20
[static] Constant associated with the key code value for the Caps Lock key (20).
Keyboard
  AIR-onlyCharCodeStrings : Array
[static]
Keyboard
  AIR-onlyCOMMA : uint = 188
[static] Constant associated with the key code value for the , key (188).
Keyboard
  AIR-onlyCOMMAND : uint = 15
[static] Constant associated with the Mac command key (15).
Keyboard
  CONTROL : uint = 17
[static] Constant associated with the key code value for the Control key (17).
Keyboard
  AIR-onlyD : uint = 68
[static] Constant associated with the key code value for the D key (68).
Keyboard
  DELETE : uint = 46
[static] Constant associated with the key code value for the Delete key (46).
Keyboard
  DOWN : uint = 40
[static] Constant associated with the key code value for the Down Arrow key (40).
Keyboard
  AIR-onlyE : uint = 69
[static] Constant associated with the key code value for the E key (69).
Keyboard
  END : uint = 35
[static] Constant associated with the key code value for the End key (35).
Keyboard
  ENTER : uint = 13
[static] Constant associated with the key code value for the Enter key (13).
Keyboard
  AIR-onlyEQUAL : uint = 187
[static] Constant associated with the key code value for the = key (187).
Keyboard
  ESCAPE : uint = 27
[static] Constant associated with the key code value for the Escape key (27).
Keyboard
  AIR-onlyF : uint = 70
[static] Constant associated with the key code value for the F key (70).
Keyboard
  F1 : uint = 112
[static] Constant associated with the key code value for the F1 key (112).
Keyboard
  F10 : uint = 121
[static] Constant associated with the key code value for the F10 key (121).
Keyboard
  F11 : uint = 122
[static] Constant associated with the key code value for the F11 key (122).
Keyboard
  F12 : uint = 123
[static] Constant associated with the key code value for the F12 key (123).
Keyboard
  F13 : uint = 124
[static] Constant associated with the key code value for the F13 key (124).
Keyboard
  F14 : uint = 125
[static] Constant associated with the key code value for the F14 key (125).
Keyboard
  F15 : uint = 126
[static] Constant associated with the key code value for the F15 key (126).
Keyboard
  F2 : uint = 113
[static] Constant associated with the key code value for the F2 key (113).
Keyboard
  F3 : uint = 114
[static] Constant associated with the key code value for the F3 key (114).
Keyboard
  F4 : uint = 115
[static] Constant associated with the key code value for the F4 key (115).
Keyboard
  F5 : uint = 116
[static] Constant associated with the key code value for the F5 key (116).
Keyboard
  F6 : uint = 117
[static] Constant associated with the key code value for the F6 key (117).
Keyboard
  F7 : uint = 118
[static] Constant associated with the key code value for the F7 key (118).
Keyboard
  F8 : uint = 119
[static] Constant associated with the key code value for the F8 key (119).
Keyboard
  F9 : uint = 120
[static] Constant associated with the key code value for the F9 key (120).
Keyboard
  AIR-onlyG : uint = 71
[static] Constant associated with the key code value for the G key (71).
Keyboard
  AIR-onlyH : uint = 72
[static] Constant associated with the key code value for the H key (72).
Keyboard
  HOME : uint = 36
[static] Constant associated with the key code value for the Home key (36).
Keyboard
  AIR-onlyI : uint = 73
[static] Constant associated with the key code value for the I key (73).
Keyboard
  INSERT : uint = 45
[static] Constant associated with the key code value for the Insert key (45).
Keyboard
  AIR-onlyJ : uint = 74
[static] Constant associated with the key code value for the J key (74).
Keyboard
  AIR-onlyK : uint = 75
[static] Constant associated with the key code value for the K key (75).
Keyboard
  AIR-onlyKEYNAME_BEGIN : String = "Begin"
[static]
Keyboard
  AIR-onlyKEYNAME_BREAK : String = "Break"
[static]
Keyboard
  AIR-onlyKEYNAME_CLEARDISPLAY : String = "ClrDsp"
[static]
Keyboard
  AIR-onlyKEYNAME_CLEARLINE : String = "ClrLn"
[static]
Keyboard
  AIR-onlyKEYNAME_DELETE : String = "Delete"
[static]
Keyboard
  AIR-onlyKEYNAME_DELETECHAR : String = "DelChr"
[static]
Keyboard
  AIR-onlyKEYNAME_DELETELINE : String = "DelLn"
[static]
Keyboard
  AIR-onlyKEYNAME_DOWNARROW : String = "Down"
[static]
Keyboard
  AIR-onlyKEYNAME_END : String = "End"
[static]
Keyboard
  AIR-onlyKEYNAME_EXECUTE : String = "Exec"
[static]
Keyboard
  AIR-onlyKEYNAME_F1 : String = "F1"
[static]
Keyboard
  AIR-onlyKEYNAME_F10 : String = "F10"
[static]
Keyboard
  AIR-onlyKEYNAME_F11 : String = "F11"
[static]
Keyboard
  AIR-onlyKEYNAME_F12 : String = "F12"
[static]
Keyboard
  AIR-onlyKEYNAME_F13 : String = "F13"
[static]
Keyboard
  AIR-onlyKEYNAME_F14 : String = "F14"
[static]
Keyboard
  AIR-onlyKEYNAME_F15 : String = "F15"
[static]
Keyboard
  AIR-onlyKEYNAME_F16 : String = "F16"
[static]
Keyboard
  AIR-onlyKEYNAME_F17 : String = "F17"
[static]
Keyboard
  AIR-onlyKEYNAME_F18 : String = "F18"
[static]
Keyboard
  AIR-onlyKEYNAME_F19 : String = "F19"
[static]
Keyboard
  AIR-onlyKEYNAME_F2 : String = "F2"
[static]
Keyboard
  AIR-onlyKEYNAME_F20 : String = "F20"
[static]
Keyboard
  AIR-onlyKEYNAME_F21 : String = "F21"
[static]
Keyboard
  AIR-onlyKEYNAME_F22 : String = "F22"
[static]
Keyboard
  AIR-onlyKEYNAME_F23 : String = "F23"
[static]
Keyboard
  AIR-onlyKEYNAME_F24 : String = "F24"
[static]
Keyboard
  AIR-onlyKEYNAME_F25 : String = "F25"
[static]
Keyboard
  AIR-onlyKEYNAME_F26 : String = "F26"
[static]
Keyboard
  AIR-onlyKEYNAME_F27 : String = "F27"
[static]
Keyboard
  AIR-onlyKEYNAME_F28 : String = "F28"
[static]
Keyboard
  AIR-onlyKEYNAME_F29 : String = "F29"
[static]
Keyboard
  AIR-onlyKEYNAME_F3 : String = "F3"
[static]
Keyboard
  AIR-onlyKEYNAME_F30 : String = "F30"
[static]
Keyboard
  AIR-onlyKEYNAME_F31 : String = "F31"
[static]
Keyboard
  AIR-onlyKEYNAME_F32 : String = "F32"
[static]
Keyboard
  AIR-onlyKEYNAME_F33 : String = "F33"
[static]
Keyboard
  AIR-onlyKEYNAME_F34 : String = "F34"
[static]
Keyboard
  AIR-onlyKEYNAME_F35 : String = "F35"
[static]
Keyboard
  AIR-onlyKEYNAME_F4 : String = "F4"
[static]
Keyboard
  AIR-onlyKEYNAME_F5 : String = "F5"
[static]
Keyboard
  AIR-onlyKEYNAME_F6 : String = "F6"
[static]
Keyboard
  AIR-onlyKEYNAME_F7 : String = "F7"
[static]
Keyboard
  AIR-onlyKEYNAME_F8 : String = "F8"
[static]
Keyboard
  AIR-onlyKEYNAME_F9 : String = "F9"
[static]
Keyboard
  AIR-onlyKEYNAME_FIND : String = "Find"
[static]
Keyboard
  AIR-onlyKEYNAME_HELP : String = "Help"
[static]
Keyboard
  AIR-onlyKEYNAME_HOME : String = "Home"
[static]
Keyboard
  AIR-onlyKEYNAME_INSERT : String = "Insert"
[static]
Keyboard
  AIR-onlyKEYNAME_INSERTCHAR : String = "InsChr"
[static]
Keyboard
  AIR-onlyKEYNAME_INSERTLINE : String = "InsLn"
[static]
Keyboard
  AIR-onlyKEYNAME_LEFTARROW : String = "Left"
[static]
Keyboard
  AIR-onlyKEYNAME_MENU : String = "Menu"
[static]
Keyboard
  AIR-onlyKEYNAME_MODESWITCH : String = "ModeSw"
[static]
Keyboard
  AIR-onlyKEYNAME_NEXT : String = "Next"
[static]
Keyboard
  AIR-onlyKEYNAME_PAGEDOWN : String = "PgDn"
[static]
Keyboard
  AIR-onlyKEYNAME_PAGEUP : String = "PgUp"
[static]
Keyboard
  AIR-onlyKEYNAME_PAUSE : String = "Pause"
[static]
Keyboard
  AIR-onlyKEYNAME_PREV : String = "Prev"
[static]
Keyboard
  AIR-onlyKEYNAME_PRINT : String = "Print"
[static]
Keyboard
  AIR-onlyKEYNAME_PRINTSCREEN : String = "PrntScrn"
[static]
Keyboard
  AIR-onlyKEYNAME_REDO : String = "Redo"
[static]
Keyboard
  AIR-onlyKEYNAME_RESET : String = "Reset"
[static]
Keyboard
  AIR-onlyKEYNAME_RIGHTARROW : String = "Right"
[static]
Keyboard
  AIR-onlyKEYNAME_SCROLLLOCK : String = "ScrlLck"
[static]
Keyboard
  AIR-onlyKEYNAME_SELECT : String = "Select"
[static]
Keyboard
  AIR-onlyKEYNAME_STOP : String = "Stop"
[static]
Keyboard
  AIR-onlyKEYNAME_SYSREQ : String = "SysReq"
[static]
Keyboard
  AIR-onlyKEYNAME_SYSTEM : String = "Sys"
[static]
Keyboard
  AIR-onlyKEYNAME_UNDO : String = "Undo"
[static]
Keyboard
  AIR-onlyKEYNAME_UPARROW : String = "Up"
[static]
Keyboard
  AIR-onlyKEYNAME_USER : String = "User"
[static]
Keyboard
  AIR-onlyL : uint = 76
[static] Constant associated with the key code value for the L key (76).
Keyboard
  LEFT : uint = 37
[static] Constant associated with the key code value for the Left Arrow key (37).
Keyboard
  AIR-onlyLEFTBRACKET : uint = 219
[static] Constant associated with the key code value for the [ key (219).
Keyboard
  AIR-onlyM : uint = 77
[static] Constant associated with the key code value for the M key (77).
Keyboard
  AIR-onlyMINUS : uint = 189
[static] Constant associated with the key code value for the - key (189).
Keyboard
  AIR-onlyN : uint = 78
[static] Constant associated with the key code value for the N key (78).
Keyboard
  AIR-onlyNUMBER_0 : uint = 48
[static] Constant associated with the key code value for the 0 key (48).
Keyboard
  AIR-onlyNUMBER_1 : uint = 49
[static] Constant associated with the key code value for the 1 key (49).
Keyboard
  AIR-onlyNUMBER_2 : uint = 50
[static] Constant associated with the key code value for the 2 key (50).
Keyboard
  AIR-onlyNUMBER_3 : uint = 51
[static] Constant associated with the key code value for the 3 key (51).
Keyboard
  AIR-onlyNUMBER_4 : uint = 52
[static] Constant associated with the key code value for the 4 key (52).
Keyboard
  AIR-onlyNUMBER_5 : uint = 53
[static] Constant associated with the key code value for the 5 key (53).
Keyboard
  AIR-onlyNUMBER_6 : uint = 54
[static] Constant associated with the key code value for the 6 key (54).
Keyboard
  AIR-onlyNUMBER_7 : uint = 55
[static] Constant associated with the key code value for the 7 key (55).
Keyboard
  AIR-onlyNUMBER_8 : uint = 56
[static] Constant associated with the key code value for the 8 key (56).
Keyboard
  AIR-onlyNUMBER_9 : uint = 57
[static] Constant associated with the key code value for the 9 key (57).
Keyboard
  AIR-onlyNUMPAD : uint = 21
[static] Constant associated with the pseudo-key code for the the number pad (21).
Keyboard
  NUMPAD_0 : uint = 96
[static] Constant associated with the key code value for the number 0 key on the number pad (96).
Keyboard
  NUMPAD_1 : uint = 97
[static] Constant associated with the key code value for the number 1 key on the number pad (97).
Keyboard
  NUMPAD_2 : uint = 98
[static] Constant associated with the key code value for the number 2 key on the number pad (98).
Keyboard
  NUMPAD_3 : uint = 99
[static] Constant associated with the key code value for the number 3 key on the number pad (99).
Keyboard
  NUMPAD_4 : uint = 100
[static] Constant associated with the key code value for the number 4 key on the number pad (100).
Keyboard
  NUMPAD_5 : uint = 101
[static] Constant associated with the key code value for the number 5 key on the number pad (101).
Keyboard
  NUMPAD_6 : uint = 102
[static] Constant associated with the key code value for the number 6 key on the number pad (102).
Keyboard
  NUMPAD_7 : uint = 103
[static] Constant associated with the key code value for the number 7 key on the number pad (103).
Keyboard
  NUMPAD_8 : uint = 104
[static] Constant associated with the key code value for the number 8 key on the number pad (104).
Keyboard
  NUMPAD_9 : uint = 105
[static] Constant associated with the key code value for the number 9 key on the number pad (105).
Keyboard
  NUMPAD_ADD : uint = 107
[static] Constant associated with the key code value for the addition key on the number pad (107).
Keyboard
  NUMPAD_DECIMAL : uint = 110
[static] Constant associated with the key code value for the decimal key on the number pad (110).
Keyboard
  NUMPAD_DIVIDE : uint = 111
[static] Constant associated with the key code value for the division key on the number pad (111).
Keyboard
  NUMPAD_ENTER : uint = 108
[static] Constant associated with the key code value for the Enter key on the number pad (108).
Keyboard
  NUMPAD_MULTIPLY : uint = 106
[static] Constant associated with the key code value for the multiplication key on the number pad (106).
Keyboard
  NUMPAD_SUBTRACT : uint = 109
[static] Constant associated with the key code value for the subtraction key on the number pad (109).
Keyboard
  AIR-onlyO : uint = 79
[static] Constant associated with the key code value for the O key (79).
Keyboard
  AIR-onlyP : uint = 80
[static] Constant associated with the key code value for the P key (80).
Keyboard
  PAGE_DOWN : uint = 34
[static] Constant associated with the key code value for the Page Down key (34).
Keyboard
  PAGE_UP : uint = 33
[static] Constant associated with the key code value for the Page Up key (33).
Keyboard
  AIR-onlyPERIOD : uint = 190
[static] Constant associated with the key code value for the .
Keyboard
  AIR-onlyQ : uint = 81
[static] Constant associated with the key code value for the Q key (81).
Keyboard
  AIR-onlyQUOTE : uint = 222
[static] Constant associated with the key code value for the ' key (222).
Keyboard
  AIR-onlyR : uint = 82
[static] Constant associated with the key code value for the R key (82).
Keyboard
  RIGHT : uint = 39
[static] Constant associated with the key code value for the Right Arrow key (39).
Keyboard
  AIR-onlyRIGHTBRACKET : uint = 221
[static] Constant associated with the key code value for the ] key (221).
Keyboard
  AIR-onlyS : uint = 83
[static] Constant associated with the key code value for the S key (83).
Keyboard
  AIR-onlySEMICOLON : uint = 186
[static] Constant associated with the key code value for the ; key (186).
Keyboard
  SHIFT : uint = 16
[static] Constant associated with the key code value for the Shift key (16).
Keyboard
  AIR-onlySLASH : uint = 191
[static] Constant associated with the key code value for the / key (191).
Keyboard
  SPACE : uint = 32
[static] Constant associated with the key code value for the Spacebar (32).
Keyboard
  AIR-onlySTRING_BEGIN : String = "?"
[static]
Keyboard
  AIR-onlySTRING_BREAK : String = "?"
[static]
Keyboard
  AIR-onlySTRING_CLEARDISPLAY : String = "?"
[static]
Keyboard
  AIR-onlySTRING_CLEARLINE : String = "?"
[static]
Keyboard
  AIR-onlySTRING_DELETE : String = "?"
[static]
Keyboard
  AIR-onlySTRING_DELETECHAR : String = "?"
[static]
Keyboard
  AIR-onlySTRING_DELETELINE : String = "?"
[static]
Keyboard
  AIR-onlySTRING_DOWNARROW : String = "?"
[static]
Keyboard
  AIR-onlySTRING_END : String = "?"
[static]
Keyboard
  AIR-onlySTRING_EXECUTE : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F1 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F10 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F11 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F12 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F13 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F14 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F15 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F16 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F17 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F18 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F19 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F2 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F20 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F21 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F22 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F23 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F24 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F25 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F26 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F27 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F28 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F29 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F3 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F30 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F31 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F32 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F33 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F34 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F35 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F4 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F5 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F6 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F7 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F8 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_F9 : String = "?"
[static]
Keyboard
  AIR-onlySTRING_FIND : String = "?"
[static]
Keyboard
  AIR-onlySTRING_HELP : String = "?"
[static]
Keyboard
  AIR-onlySTRING_HOME : String = "?"
[static]
Keyboard
  AIR-onlySTRING_INSERT : String = "?"
[static]
Keyboard
  AIR-onlySTRING_INSERTCHAR : String = "?"
[static]
Keyboard
  AIR-onlySTRING_INSERTLINE : String = "?"
[static]
Keyboard
  AIR-onlySTRING_LEFTARROW : String = "?"
[static]
Keyboard
  AIR-onlySTRING_MENU : String = "?"
[static]
Keyboard
  AIR-onlySTRING_MODESWITCH : String = "?"
[static]
Keyboard
  AIR-onlySTRING_NEXT : String = "?"
[static]
Keyboard
  AIR-onlySTRING_PAGEDOWN : String = "?"
[static]
Keyboard
  AIR-onlySTRING_PAGEUP : String = "?"
[static]
Keyboard
  AIR-onlySTRING_PAUSE : String = "?"
[static]
Keyboard
  AIR-onlySTRING_PREV : String = "?"