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:

 

metaKey : Boolean  

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

Example:

Run

Results:

 

shiftKey : Boolean  

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

Example:

Run

Results:

 

which : Number  

Example:

Run

Results: