Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

location property

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

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

 

Syntax

JavaScript

p = object.location

 

Property values

Type: Integer

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 location property is not set during onkeypress events. It is available only during onkeydown and onkeyup events.

See also

KeyboardEvent
Reference
onkeydown
onkeyup

 

 

Show:
© 2017 Microsoft