JSFiddle - React, Tailwind, and code Playground

HTML

<body>
  <h1>Click here and press any key combination</h1>
  <h2 id="temp">hi</h2>
</body>

JavaScript

$(document).keydown(function(e) {
      var key = String.fromCharCode(e.which);
      var alt = e.altKey;
      var ctrl = e.ctrlKey;
      var shift = e.shiftKey;
      document.getElementById("temp").innerHTML = "Key:" + key + "\nAlt:" + alt + "\nCtrl:" + ctrl + "\nShift:" + shift;
    });
$(document).keyup(function(e) {
      document.getElementById("temp").innerHTML = "";
    });