JavaScripture
Contribute via GitHub Feedback

JavaScript KeyboardEvent : UIEvent

Instance Properties

altKey : Boolean  

Returns true if the keyboard's alt (Option on Mac) key is pressed.

Example:

Run

Results:

 

charCode : Number  

The effective character. Only valid for keypress events. Use String.fromCharCode() to get a string version of the pressed character.

Example:

Run

Results:

 

ctrlKey : Boolean  

Returns true if the keyboard's control key is pressed.

Example:

Run

Results:

 

keyCode : Number  

Example:

Run

Results:

 

location : Number  

One of DOM_KEY_LOCATION_STANDARD, DOM_KEY_LOCATION_LEFT, DOM_KEY_LOCATION_RIGHT, DOM_KEY_LOCATION_NUMPAD.

Example:

Run

Results:

 

metaKey : Boolean  

Returns true if the keyboard's meta (Command on Mac, not available on Windows) key is pressed.

Example:

Run

Results:

 

repeat : Boolean  

Returns true if the key event was generate by the user holding the key down.

Example:

Run

Results:

 

shiftKey : Boolean  

Returns true if the keyboard's shift key is pressed.

Example:

Run

Results:

 

which : Number  

Example:

Run

Results:

 

KeyboardEvent Properties

DOM_KEY_LOCATION_LEFT : Number    

DOM_KEY_LOCATION_NUMPAD : Number    

DOM_KEY_LOCATION_RIGHT : Number    

DOM_KEY_LOCATION_STANDARD : Number