Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
getModifierState

getModifierState method

Queries the state of the specified modifier key.

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

 

Syntax


HRESULT retVal = object.getModifierState(keyArg, state);

Parameters

keyArg [in]

Type: BSTR

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.

state [out, retval]

Type: VARIANT_BOOL

VARIANT_TRUE if the modifier key is active; otherwise, VARIANT_FALSE.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

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 IDOMKeyboardEvent::location property.

See also

Reference
IDOMMouseEvent::altKey
IDOMMouseEvent::ctrlKey
IDOMMouseEvent::metaKey
IDOMMouseEvent::shiftKey

 

 

Community Additions

ADD
Show:
© 2015 Microsoft