KeyboardEvent : UIEvent
Constructors
| key : | String | |
| code : | String | |
| location : | Number | |
| repeat : | Boolean | |
| isComposing : | Boolean | |
| ctrlKey : | Boolean | |
| shiftKey : | Boolean | |
| altKey : | Boolean | |
| metaKey : | Boolean | |
| modifierAltGraph : | Boolean | |
| modifierCapsLock : | Boolean | |
| modifierFn : | Boolean | |
| modifierFnLock : | Boolean | |
| modifierHyper : | Boolean | |
| modifierNumLock : | Boolean | |
| modifierScrollLock : | Boolean | |
| modifierSuper : | Boolean | |
| modifierSymbol : | Boolean | |
| modifierSymbolLock : | Boolean | |
| view : | Window | |
| detail : | Number | |
| bubbles : | Boolean | |
| cancelable : | Boolean | |
| composed : | Boolean |
Creates a new KeyboardEvent of the specified type and initial properties.
Instance Properties
Returns true if the keyboard's alt (Option on Mac) key is pressed. See also getModifierState().
Example:
RunResults:
The effective character. Only valid for keypress events. Use String.fromCharCode() to get a string version of the pressed character.
Example:
RunResults:
Returns true if the keyboard's control key is pressed. See also getModifierState().
Example:
RunResults:
One of DOM_KEY_LOCATION_STANDARD, DOM_KEY_LOCATION_LEFT, DOM_KEY_LOCATION_RIGHT, DOM_KEY_LOCATION_NUMPAD.
Example:
RunResults:
Returns true if the keyboard's meta (Command on Mac, the Windows logo key in some PC browsers) key is pressed. See also getModifierState().
Example:
RunResults:
Returns true if the key event was generate by the user holding the key down.
Example:
RunResults:
Returns true if the keyboard's shift key is pressed. See also getModifierState().