keydown repeat

This commit is contained in:
Matt Walsh 2022-11-17 08:30:04 -06:00
parent 52efea0b67
commit b7c2ba22a4

View file

@ -354,6 +354,10 @@ const index = (() => {
const documentKeydown = (e) => {
const code = (e.keyCode || e.which);
// 200ms repeat
if ((Date.now() - documentKeydown.lastButton ?? 0) < 200) return false;
documentKeydown.lastButton = Date.now();
if (document.fullscreenElement || document.activeElement === document.body) {
switch (code) {
case 32: // Space