getModifierState method
Queries the state of the specified modifier key.
![]() ![]() |
Syntax
HRESULT retVal = object.getModifierState(keyArg, state);
Parameters
- keyArg [in]
-
Type: BSTR
- 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
- Document Object Model (DOM) Level 3 Events Specification, Section 5.2.6
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
- IDOMKeyboardEvent::altKey
- IDOMKeyboardEvent::ctrlKey
- IDOMKeyboardEvent::metaKey
- IDOMKeyboardEvent::shiftKey
Show:

