Minor optimization for the shortcuts feature

This commit is contained in:
redphx
2024-05-26 07:46:09 +07:00
parent 8ba305af2b
commit 2a9b070373
2 changed files with 4 additions and 4 deletions

View File

@@ -69,9 +69,9 @@ export class ControllerShortcut {
otherButtonPressed = true;
pressed[index] = true;
// If this is newly pressed button > run action
// If this is newly pressed button -> run action
if (actions[index] && !ControllerShortcut.#buttonsCache[gamepadIndex][index]) {
ControllerShortcut.#runAction(actions[index]!);
setTimeout(() => ControllerShortcut.#runAction(actions[index]!), 0);
}
}
});