W3cubDocs

/Haxe JavaScript

KeyboardEvent

package js.html

extends UIEventEvent

@:native("KeyboardEvent") Available on js

KeyboardEvent objects describe a user interaction with the keyboard. Each event describes a key; the event type (keydown, keypress, or keyup) identifies what kind of activity was performed.

Documentation KeyboardEvent by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Constructor

new (typeArg:String, ?keyboardEventInitDict:KeyboardEventInit)

Throws:

null DOMError

Variables

read only altKey:Bool

Returns a Boolean that is true if the Alt ( Option or ⌥ on OS X) key was active when the key event was generated.

read only charCode:Int

Returns a Number representing the Unicode reference number of the key; this attribute is used only by the keypress event. For keys whose char attribute contains multiple characters, this is the Unicode value of the first character in that attribute. In Firefox 26 this returns codes for printable characters. Warning: This attribute is deprecated; you should use KeyboardEvent.key instead, if available.

read only ctrlKey:Bool

Returns a Boolean that is true if the Ctrl key was active when the key event was generated.

read only isComposing:Bool

Returns a Boolean that is true if the event is fired between after compositionstart and before compositionend.

read only key:String

Returns a DOMString representing the key value of the key represented by the event.

read only keyCode:Int

Returns a Number representing a system and implementation dependent numerical code identifying the unmodified value of the pressed key. Warning: This attribute is deprecated; you should use KeyboardEvent.key instead, if available.

read only location:Int

Returns a Number representing the location of the key on the keyboard or other input device.

read only metaKey:Bool

Returns a Boolean that is true if the Meta key (on Mac keyboards, the ⌘ Command key; on Windows keyboards, the Windows key (⊞)) was active when the key event was generated.

read only repeat:Bool

Returns a Boolean that is true if the key is being held down such that it is automatically repeating.

read only shiftKey:Bool

Returns a Boolean that is true if the Shift key was active when the key event was generated.

Methods

getModifierState (key:String):Bool

Returns a Boolean indicating if the modifier key, like Alt, Shift, Ctrl, or Meta, was pressed when the event was created.

initKeyEvent (type:String, canBubble:Bool, cancelable:Bool, view:Window, ctrlKey:Bool, altKey:Bool, shiftKey:Bool, metaKey:Bool, keyCode:Int, charCode:Int):Void

Initializes a KeyboardEvent object. This has only been implemented by Gecko (others used KeyboardEvent.initKeyboardEvent()) and should not be used any more. The standard modern way is to use the KeyboardEvent.KeyboardEvent constructor.

Static variables

@:value(1) static inline read only DOM_KEY_LOCATION_LEFT:Int = 1

@:value(3) static inline read only DOM_KEY_LOCATION_NUMPAD:Int = 3

@:value(2) static inline read only DOM_KEY_LOCATION_RIGHT:Int = 2

@:value(0) static inline read only DOM_KEY_LOCATION_STANDARD:Int = 0

@:value(48) static inline read only DOM_VK_0:Int = 48

@:value(49) static inline read only DOM_VK_1:Int = 49

@:value(50) static inline read only DOM_VK_2:Int = 50

@:value(51) static inline read only DOM_VK_3:Int = 51

@:value(52) static inline read only DOM_VK_4:Int = 52

@:value(53) static inline read only DOM_VK_5:Int = 53

@:value(54) static inline read only DOM_VK_6:Int = 54

@:value(55) static inline read only DOM_VK_7:Int = 55

@:value(56) static inline read only DOM_VK_8:Int = 56

@:value(57) static inline read only DOM_VK_9:Int = 57

@:value(65) static inline read only DOM_VK_A:Int = 65

@:value(30) static inline read only DOM_VK_ACCEPT:Int = 30

@:value(107) static inline read only DOM_VK_ADD:Int = 107

@:value(18) static inline read only DOM_VK_ALT:Int = 18

@:value(225) static inline read only DOM_VK_ALTGR:Int = 225

@:value(166) static inline read only DOM_VK_AMPERSAND:Int = 166

@:value(170) static inline read only DOM_VK_ASTERISK:Int = 170

@:value(64) static inline read only DOM_VK_AT:Int = 64

@:value(246) static inline read only DOM_VK_ATTN:Int = 246

@:value(66) static inline read only DOM_VK_B:Int = 66

@:value(192) static inline read only DOM_VK_BACK_QUOTE:Int = 192

@:value(220) static inline read only DOM_VK_BACK_SLASH:Int = 220

@:value(8) static inline read only DOM_VK_BACK_SPACE:Int = 8

@:value(67) static inline read only DOM_VK_C:Int = 67

@:value(3) static inline read only DOM_VK_CANCEL:Int = 3

@:value(20) static inline read only DOM_VK_CAPS_LOCK:Int = 20

@:value(160) static inline read only DOM_VK_CIRCUMFLEX:Int = 160

@:value(12) static inline read only DOM_VK_CLEAR:Int = 12

@:value(221) static inline read only DOM_VK_CLOSE_BRACKET:Int = 221

@:value(175) static inline read only DOM_VK_CLOSE_CURLY_BRACKET:Int = 175

@:value(169) static inline read only DOM_VK_CLOSE_PAREN:Int = 169

@:value(58) static inline read only DOM_VK_COLON:Int = 58

@:value(188) static inline read only DOM_VK_COMMA:Int = 188

@:value(93) static inline read only DOM_VK_CONTEXT_MENU:Int = 93

@:value(17) static inline read only DOM_VK_CONTROL:Int = 17

@:value(28) static inline read only DOM_VK_CONVERT:Int = 28

@:value(247) static inline read only DOM_VK_CRSEL:Int = 247

@:value(68) static inline read only DOM_VK_D:Int = 68

@:value(110) static inline read only DOM_VK_DECIMAL:Int = 110

@:value(46) static inline read only DOM_VK_DELETE:Int = 46

@:value(111) static inline read only DOM_VK_DIVIDE:Int = 111

@:value(164) static inline read only DOM_VK_DOLLAR:Int = 164

@:value(162) static inline read only DOM_VK_DOUBLE_QUOTE:Int = 162

@:value(40) static inline read only DOM_VK_DOWN:Int = 40

@:value(69) static inline read only DOM_VK_E:Int = 69

@:value(22) static inline read only DOM_VK_EISU:Int = 22

@:value(35) static inline read only DOM_VK_END:Int = 35

@:value(61) static inline read only DOM_VK_EQUALS:Int = 61

@:value(249) static inline read only DOM_VK_EREOF:Int = 249

@:value(27) static inline read only DOM_VK_ESCAPE:Int = 27

@:value(161) static inline read only DOM_VK_EXCLAMATION:Int = 161

@:value(43) static inline read only DOM_VK_EXECUTE:Int = 43

@:value(248) static inline read only DOM_VK_EXSEL:Int = 248

@:value(70) static inline read only DOM_VK_F:Int = 70

@:value(112) static inline read only DOM_VK_F1:Int = 112

@:value(121) static inline read only DOM_VK_F10:Int = 121

@:value(122) static inline read only DOM_VK_F11:Int = 122

@:value(123) static inline read only DOM_VK_F12:Int = 123

@:value(124) static inline read only DOM_VK_F13:Int = 124

@:value(125) static inline read only DOM_VK_F14:Int = 125

@:value(126) static inline read only DOM_VK_F15:Int = 126

@:value(127) static inline read only DOM_VK_F16:Int = 127

@:value(128) static inline read only DOM_VK_F17:Int = 128

@:value(129) static inline read only DOM_VK_F18:Int = 129

@:value(130) static inline read only DOM_VK_F19:Int = 130

@:value(113) static inline read only DOM_VK_F2:Int = 113

@:value(131) static inline read only DOM_VK_F20:Int = 131

@:value(132) static inline read only DOM_VK_F21:Int = 132

@:value(133) static inline read only DOM_VK_F22:Int = 133

@:value(134) static inline read only DOM_VK_F23:Int = 134

@:value(135) static inline read only DOM_VK_F24:Int = 135

@:value(114) static inline read only DOM_VK_F3:Int = 114

@:value(115) static inline read only DOM_VK_F4:Int = 115

@:value(116) static inline read only DOM_VK_F5:Int = 116

@:value(117) static inline read only DOM_VK_F6:Int = 117

@:value(118) static inline read only DOM_VK_F7:Int = 118

@:value(119) static inline read only DOM_VK_F8:Int = 119

@:value(120) static inline read only DOM_VK_F9:Int = 120

@:value(24) static inline read only DOM_VK_FINAL:Int = 24

@:value(71) static inline read only DOM_VK_G:Int = 71

@:value(62) static inline read only DOM_VK_GREATER_THAN:Int = 62

@:value(72) static inline read only DOM_VK_H:Int = 72

@:value(21) static inline read only DOM_VK_HANGUL:Int = 21

@:value(25) static inline read only DOM_VK_HANJA:Int = 25

@:value(163) static inline read only DOM_VK_HASH:Int = 163

@:value(6) static inline read only DOM_VK_HELP:Int = 6

@:value(36) static inline read only DOM_VK_HOME:Int = 36

@:value(173) static inline read only DOM_VK_HYPHEN_MINUS:Int = 173

@:value(73) static inline read only DOM_VK_I:Int = 73

@:value(45) static inline read only DOM_VK_INSERT:Int = 45

@:value(74) static inline read only DOM_VK_J:Int = 74

@:value(23) static inline read only DOM_VK_JUNJA:Int = 23

@:value(75) static inline read only DOM_VK_K:Int = 75

@:value(21) static inline read only DOM_VK_KANA:Int = 21

@:value(25) static inline read only DOM_VK_KANJI:Int = 25

@:value(76) static inline read only DOM_VK_L:Int = 76

@:value(37) static inline read only DOM_VK_LEFT:Int = 37

@:value(60) static inline read only DOM_VK_LESS_THAN:Int = 60

@:value(77) static inline read only DOM_VK_M:Int = 77

@:value(224) static inline read only DOM_VK_META:Int = 224

@:value(31) static inline read only DOM_VK_MODECHANGE:Int = 31

@:value(106) static inline read only DOM_VK_MULTIPLY:Int = 106

@:value(78) static inline read only DOM_VK_N:Int = 78

@:value(29) static inline read only DOM_VK_NONCONVERT:Int = 29

@:value(96) static inline read only DOM_VK_NUMPAD0:Int = 96

@:value(97) static inline read only DOM_VK_NUMPAD1:Int = 97

@:value(98) static inline read only DOM_VK_NUMPAD2:Int = 98

@:value(99) static inline read only DOM_VK_NUMPAD3:Int = 99

@:value(100) static inline read only DOM_VK_NUMPAD4:Int = 100

@:value(101) static inline read only DOM_VK_NUMPAD5:Int = 101

@:value(102) static inline read only DOM_VK_NUMPAD6:Int = 102

@:value(103) static inline read only DOM_VK_NUMPAD7:Int = 103

@:value(104) static inline read only DOM_VK_NUMPAD8:Int = 104

@:value(105) static inline read only DOM_VK_NUMPAD9:Int = 105

@:value(144) static inline read only DOM_VK_NUM_LOCK:Int = 144

@:value(79) static inline read only DOM_VK_O:Int = 79

@:value(219) static inline read only DOM_VK_OPEN_BRACKET:Int = 219

@:value(174) static inline read only DOM_VK_OPEN_CURLY_BRACKET:Int = 174

@:value(168) static inline read only DOM_VK_OPEN_PAREN:Int = 168

@:value(80) static inline read only DOM_VK_P:Int = 80

@:value(253) static inline read only DOM_VK_PA1:Int = 253

@:value(34) static inline read only DOM_VK_PAGE_DOWN:Int = 34

@:value(33) static inline read only DOM_VK_PAGE_UP:Int = 33

@:value(19) static inline read only DOM_VK_PAUSE:Int = 19

@:value(165) static inline read only DOM_VK_PERCENT:Int = 165

@:value(190) static inline read only DOM_VK_PERIOD:Int = 190

@:value(172) static inline read only DOM_VK_PIPE:Int = 172

@:value(250) static inline read only DOM_VK_PLAY:Int = 250

@:value(171) static inline read only DOM_VK_PLUS:Int = 171

@:value(42) static inline read only DOM_VK_PRINT:Int = 42

@:value(44) static inline read only DOM_VK_PRINTSCREEN:Int = 44

@:value(81) static inline read only DOM_VK_Q:Int = 81

@:value(63) static inline read only DOM_VK_QUESTION_MARK:Int = 63

@:value(222) static inline read only DOM_VK_QUOTE:Int = 222

@:value(82) static inline read only DOM_VK_R:Int = 82

@:value(13) static inline read only DOM_VK_RETURN:Int = 13

@:value(39) static inline read only DOM_VK_RIGHT:Int = 39

@:value(83) static inline read only DOM_VK_S:Int = 83

@:value(145) static inline read only DOM_VK_SCROLL_LOCK:Int = 145

@:value(41) static inline read only DOM_VK_SELECT:Int = 41

@:value(59) static inline read only DOM_VK_SEMICOLON:Int = 59

@:value(108) static inline read only DOM_VK_SEPARATOR:Int = 108

@:value(16) static inline read only DOM_VK_SHIFT:Int = 16

@:value(191) static inline read only DOM_VK_SLASH:Int = 191

@:value(95) static inline read only DOM_VK_SLEEP:Int = 95

@:value(32) static inline read only DOM_VK_SPACE:Int = 32

@:value(109) static inline read only DOM_VK_SUBTRACT:Int = 109

@:value(84) static inline read only DOM_VK_T:Int = 84

@:value(9) static inline read only DOM_VK_TAB:Int = 9

@:value(176) static inline read only DOM_VK_TILDE:Int = 176

@:value(85) static inline read only DOM_VK_U:Int = 85

@:value(167) static inline read only DOM_VK_UNDERSCORE:Int = 167

@:value(38) static inline read only DOM_VK_UP:Int = 38

@:value(86) static inline read only DOM_VK_V:Int = 86

@:value(182) static inline read only DOM_VK_VOLUME_DOWN:Int = 182

@:value(181) static inline read only DOM_VK_VOLUME_MUTE:Int = 181

@:value(183) static inline read only DOM_VK_VOLUME_UP:Int = 183

@:value(87) static inline read only DOM_VK_W:Int = 87

@:value(91) static inline read only DOM_VK_WIN:Int = 91

@:value(228) static inline read only DOM_VK_WIN_ICO_00:Int = 228

@:value(230) static inline read only DOM_VK_WIN_ICO_CLEAR:Int = 230

@:value(227) static inline read only DOM_VK_WIN_ICO_HELP:Int = 227

@:value(240) static inline read only DOM_VK_WIN_OEM_ATTN:Int = 240

@:value(243) static inline read only DOM_VK_WIN_OEM_AUTO:Int = 243

@:value(245) static inline read only DOM_VK_WIN_OEM_BACKTAB:Int = 245

@:value(254) static inline read only DOM_VK_WIN_OEM_CLEAR:Int = 254

@:value(242) static inline read only DOM_VK_WIN_OEM_COPY:Int = 242

@:value(239) static inline read only DOM_VK_WIN_OEM_CUSEL:Int = 239

@:value(244) static inline read only DOM_VK_WIN_OEM_ENLW:Int = 244

@:value(241) static inline read only DOM_VK_WIN_OEM_FINISH:Int = 241

@:value(146) static inline read only DOM_VK_WIN_OEM_FJ_JISHO:Int = 146

@:value(149) static inline read only DOM_VK_WIN_OEM_FJ_LOYA:Int = 149

@:value(147) static inline read only DOM_VK_WIN_OEM_FJ_MASSHOU:Int = 147

@:value(150) static inline read only DOM_VK_WIN_OEM_FJ_ROYA:Int = 150

@:value(148) static inline read only DOM_VK_WIN_OEM_FJ_TOUROKU:Int = 148

@:value(234) static inline read only DOM_VK_WIN_OEM_JUMP:Int = 234

@:value(235) static inline read only DOM_VK_WIN_OEM_PA1:Int = 235

@:value(236) static inline read only DOM_VK_WIN_OEM_PA2:Int = 236

@:value(237) static inline read only DOM_VK_WIN_OEM_PA3:Int = 237

@:value(233) static inline read only DOM_VK_WIN_OEM_RESET:Int = 233

@:value(238) static inline read only DOM_VK_WIN_OEM_WSCTRL:Int = 238

@:value(88) static inline read only DOM_VK_X:Int = 88

@:value(89) static inline read only DOM_VK_Y:Int = 89

@:value(90) static inline read only DOM_VK_Z:Int = 90

@:value(251) static inline read only DOM_VK_ZOOM:Int = 251

© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/KeyboardEvent.html