Skip to content

Commit 58b6f39

Browse files
committed
KeyboardEvent: Add comments for DOM_KEY_LOCATION_*
1 parent 13e6d2e commit 58b6f39

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

src/main/scala/org/scalajs/dom/raw/lib.scala

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2659,7 +2659,7 @@ class KeyboardEvent(typeArg: String, keyboardEventInit: KeyboardEventInit)
26592659

26602660
/**
26612661
* The location of the key on the keyboard or other input device.
2662-
* See the constants in the KeyboardEvent object.
2662+
* See the constants in the [[KeyboardEvent]] object.
26632663
*
26642664
* MDN
26652665
*/
@@ -2742,12 +2742,54 @@ trait KeyboardEventInit extends js.Object {
27422742
@js.native
27432743
@JSGlobal
27442744
object KeyboardEvent extends js.Object {
2745-
def DOM_KEY_LOCATION_RIGHT: Int = js.native
27462745

2746+
/**
2747+
* The key has only one version, or can't be distinguished between the left
2748+
* and right versions of the key, and was not pressed on the numeric keypad
2749+
* or a key that is considered to be part of the keypad.
2750+
*
2751+
* MDN
2752+
*/
27472753
def DOM_KEY_LOCATION_STANDARD: Int = js.native
27482754

2755+
/**
2756+
* The key was the left-hand version of the key; for example, the left-hand
2757+
* Control key was pressed on a standard 101 key US keyboard. This value is
2758+
* only used for keys that have more that one possible location on the
2759+
* keyboard.
2760+
*
2761+
* MDN
2762+
*/
27492763
def DOM_KEY_LOCATION_LEFT: Int = js.native
27502764

2765+
/**
2766+
* The key was the right-hand version of the key; for example, the right-hand
2767+
* Control key is pressed on a standard 101 key US keyboard. This value is
2768+
* only used for keys that have more that one possible location on the
2769+
* keyboard.
2770+
*
2771+
* MDN
2772+
*/
2773+
def DOM_KEY_LOCATION_RIGHT: Int = js.native
2774+
2775+
/**
2776+
* The key was on the numeric keypad, or has a virtual key code that
2777+
* corresponds to the numeric keypad.
2778+
*
2779+
* @note When NumLock is locked, Gecko always returns
2780+
* [[DOM_KEY_LOCATION_NUMPAD]] for the keys on the numeric pad.
2781+
* Otherwise, when NumLock is unlocked and the keyboard actually has
2782+
* a numeric keypad, Gecko always returns [[DOM_KEY_LOCATION_NUMPAD]]
2783+
* too. On the other hand, if the keyboard doesn't have a keypad, such
2784+
* as on a notebook computer, some keys become Numpad only when NumLock
2785+
* is locked. When such keys fires key events, the location attribute
2786+
* value depends on the key. That is, it must not be
2787+
* [[DOM_KEY_LOCATION_NUMPAD]].
2788+
* @note NumLock key's key events indicate [[DOM_KEY_LOCATION_STANDARD]] both
2789+
* on Gecko and Internet Explorer.
2790+
*
2791+
* MDN
2792+
*/
27512793
def DOM_KEY_LOCATION_NUMPAD: Int = js.native
27522794
}
27532795

0 commit comments

Comments
 (0)