Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

KeyboardEvent()

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

The KeyboardEvent() constructor creates a new KeyboardEvent.

Syntax

 event = new KeyboardEvent(typeArg, KeyboardEventInit);

Values

typeArg
Is a DOMString representing the name of the event.
KeyboardEventInitOptional
Is a KeyboardEventInit dictionary, having the following fields:

The KeyboardEventInit dictionary also accepts fields from the UIEventInit and EventInit dictionaries.

Specifications

Specification Status Comment
Document Object Model (DOM) Level 3 Events Specification
The definition of 'KeyboardEvent()' in that specification.
Working Draft Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) 31 (31) No support (Yes) ?
Add code and key to init 49.0        
Feature Android Android Webview Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ? (Yes) 31.0 (31) No support (Yes) ? (Yes)
Add code and key to init No support 49.0         49.0

See also

文档标签和贡献者

 此页面的贡献者: jwhitlock, torbasow, jpmedley, nyrosmith, fscholz, teoli
 最后编辑者: jwhitlock,