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

staticinlineread onlyA:Int

Constant associated with the key code value for the A key(65).

staticinlineread onlyALTERNATE:Int

Constant associated with the key code value for the Alternate(Option) key (18).

staticinlineread onlyB:Int

Constant associated with the key code value for the B key(66).

staticinlineread onlyBACKQUOTE:Int

Constant associated with the key code value for the ` key(192).

staticinlineread onlyBACKSLASH:Int

Constant associated with the key code value for the \ key(220).

staticinlineread onlyBACKSPACE:Int

Constant associated with the key code value for the Backspace key(8).

staticinlineread onlyC:Int

Constant associated with the key code value for the C key(67).

staticinlineread onlyCAPS_LOCK:Int

Constant associated with the key code value for the Caps Lock key(20).

staticinlineread onlyCOMMA:Int

Constant associated with the key code value for the , key(188).

staticinlineread onlyCOMMAND:Int

Constant associated with the Mac command key(15). This constant is currently only used for setting menu key equivalents.

staticinlineread onlyCONTROL:Int

Constant associated with the key code value for the Control key(17).

staticinlineread onlyD:Int

Constant associated with the key code value for the D key(68).

staticinlineread onlyDELETE:Int

Constant associated with the key code value for the Delete key(46).

staticinlineread onlyDOWN:Int

Constant associated with the key code value for the Down Arrow key(40).

staticinlineread onlyE:Int

Constant associated with the key code value for the E key(69).

staticinlineread onlyEND:Int

Constant associated with the key code value for the End key(35).

staticinlineread onlyENTER:Int

Constant associated with the key code value for the Enter key(13).

staticinlineread onlyEQUAL:Int

Constant associated with the key code value for the:Int = key(187).

staticinlineread onlyESCAPE:Int

Constant associated with the key code value for the Escape key(27).

staticinlineread onlyF:Int

Constant associated with the key code value for the F key(70).

staticinlineread onlyF1:Int

Constant associated with the key code value for the F1 key(112).

staticinlineread onlyF10:Int

Constant associated with the key code value for the F10 key(121).

staticinlineread onlyF11:Int

Constant associated with the key code value for the F11 key(122).

staticinlineread onlyF12:Int

Constant associated with the key code value for the F12 key(123).

staticinlineread onlyF13:Int

Constant associated with the key code value for the F13 key(124).

staticinlineread onlyF14:Int

Constant associated with the key code value for the F14 key(125).

staticinlineread onlyF15:Int

Constant associated with the key code value for the F15 key(126).

staticinlineread onlyF2:Int

Constant associated with the key code value for the F2 key(113).

staticinlineread onlyF3:Int

Constant associated with the key code value for the F3 key(114).

staticinlineread onlyF4:Int

Constant associated with the key code value for the F4 key(115).

staticinlineread onlyF5:Int

Constant associated with the key code value for the F5 key(116).

staticinlineread onlyF6:Int

Constant associated with the key code value for the F6 key(117).

staticinlineread onlyF7:Int

Constant associated with the key code value for the F7 key(118).

staticinlineread onlyF8:Int

Constant associated with the key code value for the F8 key(119).

staticinlineread onlyF9:Int

Constant associated with the key code value for the F9 key(120).

staticinlineread onlyG:Int

Constant associated with the key code value for the G key(71).

staticinlineread onlyH:Int

Constant associated with the key code value for the H key(72).

staticinlineread onlyHOME:Int

Constant associated with the key code value for the Home key(36).

staticinlineread onlyI:Int

Constant associated with the key code value for the I key(73).

staticinlineread onlyINSERT:Int

Constant associated with the key code value for the Insert key(45).

staticinlineread onlyJ:Int

Constant associated with the key code value for the J key(74).

staticinlineread onlyK:Int

Constant associated with the key code value for the K key(75).

staticinlineread onlyL:Int

Constant associated with the key code value for the L key(76).

staticinlineread onlyLEFT:Int

Constant associated with the key code value for the Left Arrow key(37).

staticinlineread onlyLEFTBRACKET:Int

Constant associated with the key code value for the [ key(219).

staticinlineread onlyM:Int

Constant associated with the key code value for the M key(77).

staticinlineread onlyMINUS:Int

Constant associated with the key code value for the - key(189).

staticinlineread onlyN:Int

Constant associated with the key code value for the N key(78).

staticinlineread onlyNUMBER_0:Int

Constant associated with the key code value for the 0 key(48).

staticinlineread onlyNUMBER_1:Int

Constant associated with the key code value for the 1 key(49).

staticinlineread onlyNUMBER_2:Int

Constant associated with the key code value for the 2 key(50).

staticinlineread onlyNUMBER_3:Int

Constant associated with the key code value for the 3 key(51).

staticinlineread onlyNUMBER_4:Int

Constant associated with the key code value for the 4 key(52).

staticinlineread onlyNUMBER_5:Int

Constant associated with the key code value for the 5 key(53).

staticinlineread onlyNUMBER_6:Int

Constant associated with the key code value for the 6 key(54).

staticinlineread onlyNUMBER_7:Int

Constant associated with the key code value for the 7 key(55).

staticinlineread onlyNUMBER_8:Int

Constant associated with the key code value for the 8 key(56).

staticinlineread onlyNUMBER_9:Int

Constant associated with the key code value for the 9 key(57).

staticinlineread onlyNUMPAD:Int

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

Constant associated with the key code value for the number 0 key on the number pad(96).

staticinlineread onlyNUMPAD_1:Int

Constant associated with the key code value for the number 1 key on the number pad(97).

staticinlineread onlyNUMPAD_2:Int

Constant associated with the key code value for the number 2 key on the number pad(98).

staticinlineread onlyNUMPAD_3:Int

Constant associated with the key code value for the number 3 key on the number pad(99).

staticinlineread onlyNUMPAD_4:Int

Constant associated with the key code value for the number 4 key on the number pad(100).

staticinlineread onlyNUMPAD_5:Int

Constant associated with the key code value for the number 5 key on the number pad(101).

staticinlineread onlyNUMPAD_6:Int

Constant associated with the key code value for the number 6 key on the number pad(102).

staticinlineread onlyNUMPAD_7:Int

Constant associated with the key code value for the number 7 key on the number pad(103).

staticinlineread onlyNUMPAD_8:Int

Constant associated with the key code value for the number 8 key on the number pad(104).

staticinlineread onlyNUMPAD_9:Int

Constant associated with the key code value for the number 9 key on the number pad(105).

staticinlineread onlyNUMPAD_ADD:Int

Constant associated with the key code value for the addition key on the number pad(107).

staticinlineread onlyNUMPAD_DECIMAL:Int

Constant associated with the key code value for the decimal key on the number pad(110).

staticinlineread onlyNUMPAD_DIVIDE:Int

Constant associated with the key code value for the division key on the number pad(111).

staticinlineread onlyNUMPAD_ENTER:Int

Constant associated with the key code value for the Enter key on the number pad(108).

staticinlineread onlyNUMPAD_MULTIPLY:Int

Constant associated with the key code value for the multiplication key on the number pad(106).

staticinlineread onlyNUMPAD_SUBTRACT:Int

Constant associated with the key code value for the subtraction key on the number pad(109).

staticinlineread onlyO:Int

Constant associated with the key code value for the O key(79).

staticinlineread onlyP:Int

Constant associated with the key code value for the P key(80).

staticinlineread onlyPAGE_DOWN:Int

Constant associated with the key code value for the Page Down key(34).

staticinlineread onlyPAGE_UP:Int

Constant associated with the key code value for the Page Up key(33).

staticinlineread onlyPERIOD:Int

Constant associated with the key code value for the . key(190).

staticinlineread onlyQ:Int

Constant associated with the key code value for the Q key(81).

staticinlineread onlyQUOTE:Int

Constant associated with the key code value for the ' key(222).

staticinlineread onlyR:Int

Constant associated with the key code value for the R key(82).

staticinlineread onlyRIGHT:Int

Constant associated with the key code value for the Right Arrow key(39).

staticinlineread onlyRIGHTBRACKET:Int

Constant associated with the key code value for the ] key(221).

staticinlineread onlyS:Int

Constant associated with the key code value for the S key(83).

staticinlineread onlySEMICOLON:Int

Constant associated with the key code value for the ; key(186).

staticinlineread onlySHIFT:Int

Constant associated with the key code value for the Shift key(16).

staticinlineread onlySLASH:Int

Constant associated with the key code value for the / key(191).

staticinlineread onlySPACE:Int

Constant associated with the key code value for the Spacebar(32).

staticinlineread onlyT:Int

Constant associated with the key code value for the T key(84).

staticinlineread onlyTAB:Int

Constant associated with the key code value for the Tab key(9).

staticinlineread onlyU:Int

Constant associated with the key code value for the U key(85).

staticinlineread onlyUP:Int

Constant associated with the key code value for the Up Arrow key(38).

staticinlineread onlyV:Int

Constant associated with the key code value for the V key(85).

staticinlineread onlyW:Int

Constant associated with the key code value for the W key(87).

staticinlineread onlyX:Int

Constant associated with the key code value for the X key(88).

staticinlineread onlyY:Int

Constant associated with the key code value for the Y key(89).

staticinlineread onlyZ:Int

Constant associated with the key code value for the Z key(90).

staticread onlycapsLock:Bool

Specifies whether the Caps Lock key is activated(true) or not(false).

staticread onlynumLock:Bool

Specifies whether the Num Lock key is activated(true) or not (false).

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.