            "repeat": event.repeat,
            "type": event.type
          });
          appendMessage(`${event.type}(code:${event.code}, key:${key}, which:${event.which})`);
        }

        function resetEvents() {
            allEvents.events.length = 0;
            displayMessage("");
        }
    </script>
</head>
<body>
  <div>
    <h2>KeyReporter</h2>
    <input type="text" id="keys" size="80"
           onkeyup="recordEvent(event)"
           onkeypress="recordEvent(event)"
           onkeydown