JSFiddle - React, Tailwind, and code Playground

HTML

<div></div>

JavaScript

window.addEventListener('keydown', e =>
	document.querySelector('div').innerHTML = e.key + ' ' + e.code
);