EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

getModifierState method

Queries the state of the specified modifier key.

Document Object Model (DOM) Level 3 Events Specification, Section 5.2.6

Syntax

object.getModifierState(keyArg, state)

Parameters

keyArg [in]

Type: String

Alt

The left or right Alt key.

AltGraph

The Ctrl and Alt keys.

CapsLock

The Caps Lock toggle.

Control

The left or right Ctrl key.

Meta

The Meta/Control key.

NumLock

The Num Lock toggle.

Scroll

The Scroll Lock toggle.

Shift

The left or right Shift key.

Win

The left or right Windows logo key.

Return value

Type: Boolean

true if the modifier key is active; otherwise, false.

Standards information

Remarks

Some keyboard configurations contain a left and right modifier key. To determine whether the left or right key is pressed, use the location property.

See also

DragEvent
KeyboardEvent
MouseEvent
MouseWheelEvent
WheelEvent
Reference
altKey
ctrlKey
metaKey
shiftKey

 

 

Afficher:
© 2014 Microsoft