KeyboardEvent()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Le constructeur KeyboardEvent() crée un nouveau KeyboardEvent.

Syntaxe

js
event = new KeyboardEvent(typeArg, KeyboardEventInit);

Valeurs

typeArg

Une représentation du nom de l'évènement sous forme de DOMString.

KeyboardEventInitFacultatif

Un dictionnaire KeyboardEventInit ayant les champs suivants :

Note : Le dictionnaire KeyboardEventInit accepte aussi les champs des dictionnaires UIEventInit et EventInit.

Spécifications

Specification
UI Events
# dom-keyboardevent-keyboardevent

Compatibilité des navigateurs

BCD tables only load in the browser

Voir aussi