Dispatching Event


RESETRUNFULL
<!DOCTYPE html><html><head></head><body>
    <script>
        document.onkeydown=
               ()=>alert("Did you press any key?");
        setInterval(()=>{
            document.dispatchEvent(
                new KeyboardEvent("keydown", {
                    key: "e",
                    shiftKey: false, // (default: false)
                    ctrlKey: false,  // (default: false)
                    metaKey: false   // (default: false)
                })
            );
        },3000);
    </script></body></html>