Partilhar via


IDOMKeyboardEvent interface

Provides properties and methods for keystroke events.

Members

The IDOMKeyboardEvent interface inherits from the IDispatch interface. IDOMKeyboardEvent also has these types of members:

  • Methods
  • Properties

Methods

The IDOMKeyboardEvent interface has these methods.

Method Description
getModifierState

Queries the state of the specified modifier key.

initKeyboardEvent

Initializes a new keyboard event that the IDocumentEvent::createEvent method created.

 

Properties

The IDOMKeyboardEvent interface has these properties.

Property Description

altKey

Gets a value that indicates whether the Alt key is pressed.

char

Gets a character for a key that is pressed, if available.

charCode

Gets the numeric key code of a key that is pressed.

ctrlKey

Gets a value that indicates whether the Ctrl key is pressed.

key

Gets the key identifier of a key that is pressed.

keyCode

Gets the numeric key code of a key that is pressed.

locale

Gets the locale name for the event.

location

Gets the location of a key on the keyboard or device.

metaKey

Gets a value that indicates whether the Meta/Control key is pressed.

repeat

Gets a value that indicates whether a key was pressed and held.

shiftKey

Gets a value that indicates whether the Shift key is pressed.

which

Gets the numeric code of a key that is pressed.

 

Requirements

Minimum supported client

Windows Vista with SP1, Windows 7

Minimum supported server

Windows Server 2008 R2

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

IDispatch