Press a key to display information related to it.
Code: (no key pressed)
Key: (no key pressed)
Keycode: (no key pressed)
Key location: (no key pressed)
How to detect a key/s down:
.addEventListener ("keydown" ,function (e ) {e =e || .event ;// Add scripts here e .keyCode ;// -> returns the keycode of the key that triggered the event e .key .toString ();// -> returns the ASCII character of the key that triggered the event });
How to detect a key/s up:
.addEventListener ("keyup" ,function (e ) {e =e || .event ;// Add scripts here e .keyCode ;// -> returns the keycode of the key that triggered the event e .key .toString ();// -> returns the ASCII character of the key that triggered the event });
How to detect a key/s press:
.addEventListener ("keypress" ,function (e ) {e =e || .event ;// Add scripts here e .keyCode ;// -> returns the keycode of the key that triggered the event e .key .toString ();// -> returns the ASCII character of the key that triggered the event });