Share via


location property

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

 

Syntax

HRESULT value = object.get_location(unsigned long* p);

Property values

Type: unsigned long

DOM_KEY_LOCATION_STANDARD (0x00)

The key is not on the right or left, and it did not originate from the numeric keypad (for example, the Q key).

DOM_KEY_LOCATION_LEFT (0x01)

A left key was activated (for example, the left Shift key).

DOM_KEY_LOCATION_RIGHT (0x02)

A right key was activated (for example, the right Shift key).

DOM_KEY_LOCATION_NUMPAD (0x03)

The key originated on the numeric keypad (for example, the 1 key on the numeric keypad).

DOM_KEY_LOCATION_MOBILE (0x04)

The key originated on the physical or virtual keyboard of a mobile device.

DOM_KEY_LOCATION_JOYSTICK (0x05)

The key originated on a game controller or joystick.

Standards information

Remarks

The IDOMKeyboardEvent::location property is not set during HTMLFrameSiteEvents::onkeypress events. It is available only during HTMLFrameSiteEvents::onkeydown and HTMLFrameSiteEvents::onkeyup events.

See also

Reference

HTMLFrameSiteEvents::onkeydown

HTMLFrameSiteEvents::onkeyup