class openfl.ui.Keyboard

Available on all platforms

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.

Class Fields

static var A:Int

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

static var ALTERNATE:Int

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

static var B:Int

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

static var BACKQUOTE:Int

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

static var BACKSLASH:Int

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

static var BACKSPACE:Int

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

static var BREAK:Int

static var C:Int

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

static var CAPS_LOCK:Int

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

static var COMMA:Int

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

static var COMMAND:Int

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

static var CONTROL:Int

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

static var D:Int

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

static var DELETE:Int

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

static var DOWN:Int

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

static var E:Int

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

static var END:Int

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

static var ENTER:Int

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

static var EQUAL:Int

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

static var ESCAPE:Int

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

static var F:Int

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

static var F1:Int

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

static var F10:Int

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

static var F11:Int

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

static var F12:Int

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

static var F13:Int

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

static var F14:Int

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

static var F15:Int

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

static var F2:Int

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

static var F3:Int

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

static var F4:Int

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

static var F5:Int

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

static var F6:Int

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

static var F7:Int

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

static var F8:Int

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

static var F9:Int

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

static var G:Int

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

static var H:Int

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

static var HOME:Int

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

static var I:Int

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

static var INSERT:Int

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

static var J:Int

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

static var K:Int

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

static var L:Int

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

static var LEFT:Int

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

static var LEFTBRACKET:Int

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

static var M:Int

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

static var MINUS:Int

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

static var N:Int

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

static var NUMBER_0:Int

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

static var NUMBER_1:Int

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

static var NUMBER_2:Int

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

static var NUMBER_3:Int

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

static var NUMBER_4:Int

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

static var NUMBER_5:Int

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

static var NUMBER_6:Int

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

static var NUMBER_7:Int

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

static var NUMBER_8:Int

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

static var NUMBER_9:Int

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

static var NUMLOCK:Int

static var NUMPAD:Int

Constant associated with the pseudo-key code for the the number pad(21). Use to set numpad modifier on key equivalents

static var NUMPAD_0:Int

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

static var NUMPAD_1:Int

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

static var NUMPAD_2:Int

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

static var NUMPAD_3:Int

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

static var NUMPAD_4:Int

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

static var NUMPAD_5:Int

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

static var NUMPAD_6:Int

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

static var NUMPAD_7:Int

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

static var NUMPAD_8:Int

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

static var NUMPAD_9:Int

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

static var NUMPAD_ADD:Int

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

static var NUMPAD_DECIMAL:Int

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

static var NUMPAD_DIVIDE:Int

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

static var NUMPAD_ENTER:Int

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

static var NUMPAD_MULTIPLY:Int

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

static var NUMPAD_SUBTRACT:Int

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

static var O:Int

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

static var P:Int

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

static var PAGE_DOWN:Int

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

static var PAGE_UP:Int

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

static var PERIOD:Int

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

static var Q:Int

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

static var QUOTE:Int

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

static var R:Int

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

static var RIGHT:Int

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

static var RIGHTBRACKET:Int

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

static var S:Int

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

static var SEMICOLON:Int

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

static var SHIFT:Int

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

static var SLASH:Int

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

static var SPACE:Int

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

static var T:Int

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

static var TAB:Int

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

static var U:Int

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

static var UP:Int

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

static var V:Int

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

static var W:Int

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

static var X:Int

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

static var Y:Int

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

static var Z:Int

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

static var capsLock:Bool

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

static var numLock:Bool

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

static function isAccessible():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.