JSFiddle - React, Tailwind, and code Playground

by drustTheCoder

HTML

<input id="input" type="text" />
<div id="div"></div>

JavaScript

var keys = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 191, 190, 188, 59, 222, 221, 219, 192, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 173, 61, 96, 110, 97, 98, 99, 100, 101, 102, 103, 104, 105, 111, 106, 109, 107, 220]
$("document").ready(function () {
    ar = [];

    $("#input").keydown(function (event) {
        if (ar.indexOf(event.which) === -1) {
            ar.push(event.which);
            console.log(ar.join());

        } else {
            console.log("repeated");
        }
    });
});