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.

### Hierarchy

- Keyboard

## Index

### Properties

- A
- ALTERNATE
- B
- BACKQUOTE
- BACKSLASH
- BACKSPACE
- BREAK
- C
- CAPS_LOCK
- COMMA
- COMMAND
- CONTROL
- D
- DELETE
- DOWN
- E
- END
- ENTER
- EQUAL
- ESCAPE
- F
- F1
- F10
- F11
- F12
- F13
- F14
- F15
- F2
- F3
- F4
- F5
- F6
- F7
- F8
- F9
- G
- H
- HOME
- I
- INSERT
- J
- K
- L
- LEFT
- LEFTBRACKET
- M
- MINUS
- N
- NUMBER_0
- NUMBER_1
- NUMBER_2
- NUMBER_3
- NUMBER_4
- NUMBER_5
- NUMBER_6
- NUMBER_7
- NUMBER_8
- NUMBER_9
- NUMLOCK
- NUMPAD
- NUMPAD_0
- NUMPAD_1
- NUMPAD_2
- NUMPAD_3
- NUMPAD_4
- NUMPAD_5
- NUMPAD_6
- NUMPAD_7
- NUMPAD_8
- NUMPAD_9
- NUMPAD_ADD
- NUMPAD_DECIMAL
- NUMPAD_DIVIDE
- NUMPAD_ENTER
- NUMPAD_MULTIPLY
- NUMPAD_SUBTRACT
- O
- P
- PAGE_DOWN
- PAGE_UP
- PERIOD
- Q
- QUOTE
- R
- RIGHT
- RIGHTBRACKET
- S
- SEMICOLON
- SHIFT
- SLASH
- SPACE
- T
- TAB
- U
- UP
- V
- W
- X
- Y
- Z
- capsLock
- numLock

### Methods

- isAccessible

## Properties

### Static A

A: number

- Defined in lib/openfl/ui/Keyboard.d.ts:69

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

### Static ALTERNATE

ALTERNATE: number

- Defined in lib/openfl/ui/Keyboard.d.ts:381

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

### Static B

B: number

- Defined in lib/openfl/ui/Keyboard.d.ts:74

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

### Static BACKQUOTE

BACKQUOTE: number

- Defined in lib/openfl/ui/Keyboard.d.ts:512

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

### Static BACKSLASH

BACKSLASH: number

- Defined in lib/openfl/ui/Keyboard.d.ts:522

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

### Static BACKSPACE

BACKSPACE: number

- Defined in lib/openfl/ui/Keyboard.d.ts:370

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

### Static BREAK

BREAK: number

- Defined in lib/openfl/ui/Keyboard.d.ts:404

### Static C

C: number

- Defined in lib/openfl/ui/Keyboard.d.ts:79

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

### Static CAPS_LOCK

CAPS_LOCK: number

- Defined in lib/openfl/ui/Keyboard.d.ts:409

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

### Static COMMA

COMMA: number

- Defined in lib/openfl/ui/Keyboard.d.ts:492

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

### Static COMMAND

COMMAND: number

- Defined in lib/openfl/ui/Keyboard.d.ts:392

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

### Static CONTROL

CONTROL: number

- Defined in lib/openfl/ui/Keyboard.d.ts:402

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

### Static D

D: number

- Defined in lib/openfl/ui/Keyboard.d.ts:84

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

### Static DELETE

DELETE: number

- Defined in lib/openfl/ui/Keyboard.d.ts:475

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

### Static DOWN

DOWN: number

- Defined in lib/openfl/ui/Keyboard.d.ts:465

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

### Static E

E: number

- Defined in lib/openfl/ui/Keyboard.d.ts:89

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

### Static END

END: number

- Defined in lib/openfl/ui/Keyboard.d.ts:440

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

### Static ENTER

ENTER: number

- Defined in lib/openfl/ui/Keyboard.d.ts:386

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

### Static EQUAL

EQUAL: number

- Defined in lib/openfl/ui/Keyboard.d.ts:487

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

### Static ESCAPE

ESCAPE: number

- Defined in lib/openfl/ui/Keyboard.d.ts:420

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

### Static F

F: number

- Defined in lib/openfl/ui/Keyboard.d.ts:94

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

### Static F1

F1: number

- Defined in lib/openfl/ui/Keyboard.d.ts:295

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

### Static F10

F10: number

- Defined in lib/openfl/ui/Keyboard.d.ts:340

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

### Static F11

F11: number

- Defined in lib/openfl/ui/Keyboard.d.ts:345

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

### Static F12

F12: number

- Defined in lib/openfl/ui/Keyboard.d.ts:350

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

### Static F13

F13: number

- Defined in lib/openfl/ui/Keyboard.d.ts:355

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

### Static F14

F14: number

- Defined in lib/openfl/ui/Keyboard.d.ts:360

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

### Static F15

F15: number

- Defined in lib/openfl/ui/Keyboard.d.ts:365

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

### Static F2

F2: number

- Defined in lib/openfl/ui/Keyboard.d.ts:300

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

### Static F3

F3: number

- Defined in lib/openfl/ui/Keyboard.d.ts:305

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

### Static F4

F4: number

- Defined in lib/openfl/ui/Keyboard.d.ts:310

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

### Static F5

F5: number

- Defined in lib/openfl/ui/Keyboard.d.ts:315

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

### Static F6

F6: number

- Defined in lib/openfl/ui/Keyboard.d.ts:320

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

### Static F7

F7: number

- Defined in lib/openfl/ui/Keyboard.d.ts:325

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

### Static F8

F8: number

- Defined in lib/openfl/ui/Keyboard.d.ts:330

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

### Static F9

F9: number

- Defined in lib/openfl/ui/Keyboard.d.ts:335

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

### Static G

G: number

- Defined in lib/openfl/ui/Keyboard.d.ts:99

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

### Static H

H: number

- Defined in lib/openfl/ui/Keyboard.d.ts:104

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

### Static HOME

HOME: number

- Defined in lib/openfl/ui/Keyboard.d.ts:445

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

### Static I

I: number

- Defined in lib/openfl/ui/Keyboard.d.ts:109

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

### Static INSERT

INSERT: number

- Defined in lib/openfl/ui/Keyboard.d.ts:470

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

### Static J

J: number

- Defined in lib/openfl/ui/Keyboard.d.ts:114

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

### Static K

K: number

- Defined in lib/openfl/ui/Keyboard.d.ts:119

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

### Static L

L: number

- Defined in lib/openfl/ui/Keyboard.d.ts:124

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

### Static LEFT

LEFT: number

- Defined in lib/openfl/ui/Keyboard.d.ts:450

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

### Static LEFTBRACKET

LEFTBRACKET: number

- Defined in lib/openfl/ui/Keyboard.d.ts:517

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

### Static M

M: number

- Defined in lib/openfl/ui/Keyboard.d.ts:129

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

### Static MINUS

MINUS: number

- Defined in lib/openfl/ui/Keyboard.d.ts:497

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

### Static N

N: number

- Defined in lib/openfl/ui/Keyboard.d.ts:134

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

### Static NUMBER_0

NUMBER_0: number

- Defined in lib/openfl/ui/Keyboard.d.ts:19

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

### Static NUMBER_1

NUMBER_1: number

- Defined in lib/openfl/ui/Keyboard.d.ts:24

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

### Static NUMBER_2

NUMBER_2: number

- Defined in lib/openfl/ui/Keyboard.d.ts:29

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

### Static NUMBER_3

NUMBER_3: number

- Defined in lib/openfl/ui/Keyboard.d.ts:34

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

### Static NUMBER_4

NUMBER_4: number

- Defined in lib/openfl/ui/Keyboard.d.ts:39

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

### Static NUMBER_5

NUMBER_5: number

- Defined in lib/openfl/ui/Keyboard.d.ts:44

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

### Static NUMBER_6

NUMBER_6: number

- Defined in lib/openfl/ui/Keyboard.d.ts:49

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

### Static NUMBER_7

NUMBER_7: number

- Defined in lib/openfl/ui/Keyboard.d.ts:54

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

### Static NUMBER_8

NUMBER_8: number

- Defined in lib/openfl/ui/Keyboard.d.ts:59

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

### Static NUMBER_9

NUMBER_9: number

- Defined in lib/openfl/ui/Keyboard.d.ts:64

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

### Static NUMLOCK

NUMLOCK: number

- Defined in lib/openfl/ui/Keyboard.d.ts:477

### Static NUMPAD

NUMPAD: number

- Defined in lib/openfl/ui/Keyboard.d.ts:415

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

### Static NUMPAD_0

NUMPAD_0: number

- Defined in lib/openfl/ui/Keyboard.d.ts:200

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

### Static NUMPAD_1

NUMPAD_1: number

- Defined in lib/openfl/ui/Keyboard.d.ts:206

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

### Static NUMPAD_2

NUMPAD_2: number

- Defined in lib/openfl/ui/Keyboard.d.ts:212

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

### Static NUMPAD_3

NUMPAD_3: number

- Defined in lib/openfl/ui/Keyboard.d.ts:218

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

### Static NUMPAD_4

NUMPAD_4: number

- Defined in lib/openfl/ui/Keyboard.d.ts:224

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

### Static NUMPAD_5

NUMPAD_5: number

- Defined in lib/openfl/ui/Keyboard.d.ts:230

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

### Static NUMPAD_6

NUMPAD_6: number

- Defined in lib/openfl/ui/Keyboard.d.ts:236

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

### Static NUMPAD_7

NUMPAD_7: number

- Defined in lib/openfl/ui/Keyboard.d.ts:242

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

### Static NUMPAD_8

NUMPAD_8: number

- Defined in lib/openfl/ui/Keyboard.d.ts:248

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

### Static NUMPAD_9

NUMPAD_9: number

- Defined in lib/openfl/ui/Keyboard.d.ts:254

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

### Static NUMPAD_ADD

NUMPAD_ADD: number

- Defined in lib/openfl/ui/Keyboard.d.ts:266

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

### Static NUMPAD_DECIMAL

NUMPAD_DECIMAL: number

- Defined in lib/openfl/ui/Keyboard.d.ts:284

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

### Static NUMPAD_DIVIDE

NUMPAD_DIVIDE: number

- Defined in lib/openfl/ui/Keyboard.d.ts:290

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

### Static NUMPAD_ENTER

NUMPAD_ENTER: number

- Defined in lib/openfl/ui/Keyboard.d.ts:272

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

### Static NUMPAD_MULTIPLY

NUMPAD_MULTIPLY: number

- Defined in lib/openfl/ui/Keyboard.d.ts:260

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

### Static NUMPAD_SUBTRACT

NUMPAD_SUBTRACT: number

- Defined in lib/openfl/ui/Keyboard.d.ts:278

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

### Static O

O: number

- Defined in lib/openfl/ui/Keyboard.d.ts:139

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

### Static P

P: number

- Defined in lib/openfl/ui/Keyboard.d.ts:144

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

### Static PAGE_DOWN

PAGE_DOWN: number

- Defined in lib/openfl/ui/Keyboard.d.ts:435

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

### Static PAGE_UP

PAGE_UP: number

- Defined in lib/openfl/ui/Keyboard.d.ts:430

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

### Static PERIOD

PERIOD: number

- Defined in lib/openfl/ui/Keyboard.d.ts:502

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

### Static Q

Q: number

- Defined in lib/openfl/ui/Keyboard.d.ts:149

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

### Static QUOTE

QUOTE: number

- Defined in lib/openfl/ui/Keyboard.d.ts:532

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

### Static R

R: number

- Defined in lib/openfl/ui/Keyboard.d.ts:154

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

### Static RIGHT

RIGHT: number

- Defined in lib/openfl/ui/Keyboard.d.ts:455

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

### Static RIGHTBRACKET

RIGHTBRACKET: number

- Defined in lib/openfl/ui/Keyboard.d.ts:527

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

### Static S

S: number

- Defined in lib/openfl/ui/Keyboard.d.ts:159

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

### Static SEMICOLON

SEMICOLON: number

- Defined in lib/openfl/ui/Keyboard.d.ts:482

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

### Static SHIFT

SHIFT: number

- Defined in lib/openfl/ui/Keyboard.d.ts:397

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

### Static SLASH

SLASH: number

- Defined in lib/openfl/ui/Keyboard.d.ts:507

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

### Static SPACE

SPACE: number

- Defined in lib/openfl/ui/Keyboard.d.ts:425

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

### Static T

T: number

- Defined in lib/openfl/ui/Keyboard.d.ts:164

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

### Static TAB

TAB: number

- Defined in lib/openfl/ui/Keyboard.d.ts:375

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

### Static U

U: number

- Defined in lib/openfl/ui/Keyboard.d.ts:169

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

### Static UP

UP: number

- Defined in lib/openfl/ui/Keyboard.d.ts:460

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

### Static V

V: number

- Defined in lib/openfl/ui/Keyboard.d.ts:174

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

### Static W

W: number

- Defined in lib/openfl/ui/Keyboard.d.ts:179

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

### Static X

X: number

- Defined in lib/openfl/ui/Keyboard.d.ts:184

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

### Static Y

Y: number

- Defined in lib/openfl/ui/Keyboard.d.ts:189

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

### Static Z

Z: number

- Defined in lib/openfl/ui/Keyboard.d.ts:194

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

### Static capsLock

capsLock: boolean

- Defined in lib/openfl/ui/Keyboard.d.ts:545

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

### Static numLock

numLock: boolean

- Defined in lib/openfl/ui/Keyboard.d.ts:551

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

## Methods

### Static isAccessible

- isAccessible(): boolean

- - Defined in lib/openfl/ui/Keyboard.d.ts:564

  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 boolean

  The value `true` if the last key pressed can be accessed. If access is not permitted, this method returns `false`.

Generated using TypeDoc