diff --git a/src/modules/controller-shortcut.ts b/src/modules/controller-shortcut.ts index eade7c4..cbfba39 100644 --- a/src/modules/controller-shortcut.ts +++ b/src/modules/controller-shortcut.ts @@ -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); } } }); diff --git a/src/modules/patches/controller-shortcuts.js b/src/modules/patches/controller-shortcuts.js index 03dc14a..18e269d 100644 --- a/src/modules/patches/controller-shortcuts.js +++ b/src/modules/patches/controller-shortcuts.js @@ -1,7 +1,7 @@ const currentGamepad = ${gamepadVar}; // Share button on XS controller -if (currentGamepad.buttons[17] && currentGamepad.buttons[17].value === 1) { +if (currentGamepad.buttons[17] && currentGamepad.buttons[17].pressed) { window.dispatchEvent(new Event(BxEvent.CAPTURE_SCREENSHOT)); } @@ -35,7 +35,7 @@ if (btnHome) { } // Listen to next button press - const intervalMs = 50; + const intervalMs = 16; this.inputConfiguration.useIntervalWorkerThreadForInput && this.intervalWorker ? this.intervalWorker.scheduleTimer(intervalMs) : this.pollGamepadssetTimeoutTimerID = setTimeout(this.pollGamepads, intervalMs); // Hijack this button