Keycode Info

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:

document.addEventListener("keydown", function(e) {
	e = e || window.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:

document.addEventListener("keyup", function(e) {
	e = e || window.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:

document.addEventListener("keypress", function(e) {
	e = e || window.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
});