KeyCode abstract class

Defines the keycode values for keys that are returned by KeyboardEvent.keyCode.

Important note: There is substantial divergence in how different browsers handle keycodes and their variants in different locales/keyboard layouts. We provide these constants to help make code processing keys more readable.

Constants

Aint
65
ALTint
18
APOSTROPHEint

CAUTION: This constant requires localization for other locales and keyboard layouts.

192
Bint
66
BACKSLASHint

CAUTION: This constant requires localization for other locales and keyboard layouts.

220
BACKSPACEint
8
Cint
67
CAPS_LOCKint
20
CLOSE_SQUARE_BRACKETint

CAUTION: This constant requires localization for other locales and keyboard layouts.

221
COMMAint

CAUTION: This constant requires localization for other locales and keyboard layouts.

188
CONTEXT_MENUint
93
CTRLint
17
Dint
68
DASHint

CAUTION: This constant requires localization for other locales and keyboard layouts.

189
DELETEint
46
DOWNint
40
Eint
69
EIGHTint
56
ENDint
35
ENTERint
13
EQUALSint

CAUTION: This constant requires localization for other locales and keyboard layouts.

187
ESCint
27
Fint
70
F1int
112
F2int
113
F3int
114
F4int
115
F5int
116
F6int
117
F7int
118
F8int
119
F9int
120
F10int
121
F11int
122
F12int
123
FF_EQUALSint
61
FF_SEMICOLONint
59
FIRST_MEDIA_KEYint
166
FIVEint
53
FOURint
52
Gint
71
Hint
72
HOMEint
36
Iint
73
INSERTint
45
Jint
74
Kint
75
Lint
76
LAST_MEDIA_KEYint
183
LEFTint
37
Mint
77
MAC_ENTERint
3
MAC_FF_METAint
224
METAint
91
Nint
78
NINEint
57
NUM_CENTERint

NUM_CENTER is also NUMLOCK for FF and Safari on Mac.

12
NUM_DELETEint
46
NUM_DIVISIONint
111
NUM_EASTint
39
NUM_EIGHTint
104
NUM_FIVEint
101
NUM_FOURint
100
NUM_INSERTint
45
NUM_MINUSint
109
NUM_MULTIPLYint
106
NUM_NINEint
105
NUM_NORTHint
38
NUM_NORTH_EASTint
33
NUM_NORTH_WESTint
36
NUM_ONEint
97
NUM_PERIODint
110
NUM_PLUSint
107
NUM_SEVENint
103
NUM_SIXint
102
NUM_SOUTHint
40
NUM_SOUTH_EASTint
34
NUM_SOUTH_WESTint
35
NUM_THREEint
99
NUM_TWOint
98
NUM_WESTint
37
NUM_ZEROint
96
NUMLOCKint
144
Oint
79
ONEint
49
OPEN_SQUARE_BRACKETint

CAUTION: This constant requires localization for other locales and keyboard layouts.

219
Pint
80
PAGE_DOWNint
34
PAGE_UPint
33
PAUSEint
19
PERIODint

CAUTION: This constant requires localization for other locales and keyboard layouts.

190
44
Qint
81
QUESTION_MARKint

CAUTION: The question mark is for US-keyboard layouts. It varies for other locales and keyboard layouts.

63
Rint
82
39
Sint
83
SCROLL_LOCKint
145
SEMICOLONint

CAUTION: This constant requires localization for other locales and keyboard layouts.

186
SEVENint
55
SHIFTint
16
SINGLE_QUOTEint

CAUTION: This constant requires localization for other locales and keyboard layouts.

222
SIXint
54
SLASHint

CAUTION: This constant requires localization for other locales and keyboard layouts.

191
SPACEint
32
Tint
84
TABint
9
THREEint
51
TILDEint

CAUTION: This constant requires localization for other locales and keyboard layouts.

192
TWOint
50
Uint
85
UNKNOWNint

A sentinel value if the keycode could not be determined.

-1
UPint
38
Vint
86
Wint
87
WIN_IMEint
229
WIN_KEYint
224
WIN_KEY_FF_LINUXint
0
WIN_KEY_LEFTint
91
WIN_KEY_RIGHTint
92
Xint
88
Yint
89
Zint
90
ZEROint
48

Static Methods

isCharacterKey(int keyCode) → bool

Returns true if the keyCode produces a (US keyboard) character. Note: This does not (yet) cover characters on non-US keyboards (Russian, Hebrew, etc.).

Constructors

KeyCode()

Properties

hashCodeint
read-only, inherited

The hash code for this object.

runtimeTypeType
read-only, inherited

A representation of the runtime type of the object.

Operators

operator ==(other) → bool
inherited

The equality operator.

Methods

noSuchMethod(Invocation invocation) → dynamic
inherited

Invoked when a non-existent method or property is accessed.

toString() → String
inherited

Returns a string representation of this object.

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-html/KeyCode-class.html