JSFiddle - React, Tailwind, and code Playground

by stodolaj

HTML

<!DOCTYPE html>
<html>
    <body>
        <h1>Click here and press any key combination key</h1>
    </body>
</html>

JavaScript

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