keydown repeat
This commit is contained in:
parent
0cef282b45
commit
05da87c7aa
|
@ -363,6 +363,10 @@ const index = (() => {
|
||||||
const documentKeydown = (e) => {
|
const documentKeydown = (e) => {
|
||||||
const code = (e.keyCode || e.which);
|
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) {
|
if (document.fullscreenElement || document.activeElement === document.body) {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case 32: // Space
|
case 32: // Space
|
||||||
|
|
Loading…
Reference in a new issue