KeyboardEvent keyCode
Example
Get the Unicode value of the pressed keyboard key:
let unicode = event.keyCode;
Try it Yourself »
Definition and Usage
Note: The keyCode property is deprecated. Use the key property instead.
Browser Support
NO | NO | NO | NO | NO |
Syntax
event.keyCode
Return Value
Type | Description |
A number | A Unicode character code or Unicode key code. |
Related Pages
HTML DOM reference: KeyboardEvent key Property
HTML DOM reference: KeyboardEvent charCode Property
HTML DOM reference: KeyboardEvent which Property