mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57:19 +02:00
Minor optimization for the shortcuts feature
This commit is contained in:
parent
8ba305af2b
commit
2a9b070373
@ -69,9 +69,9 @@ export class ControllerShortcut {
|
|||||||
otherButtonPressed = true;
|
otherButtonPressed = true;
|
||||||
pressed[index] = 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]) {
|
if (actions[index] && !ControllerShortcut.#buttonsCache[gamepadIndex][index]) {
|
||||||
ControllerShortcut.#runAction(actions[index]!);
|
setTimeout(() => ControllerShortcut.#runAction(actions[index]!), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const currentGamepad = ${gamepadVar};
|
const currentGamepad = ${gamepadVar};
|
||||||
|
|
||||||
// Share button on XS controller
|
// 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));
|
window.dispatchEvent(new Event(BxEvent.CAPTURE_SCREENSHOT));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ if (btnHome) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Listen to next button press
|
// 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);
|
this.inputConfiguration.useIntervalWorkerThreadForInput && this.intervalWorker ? this.intervalWorker.scheduleTimer(intervalMs) : this.pollGamepadssetTimeoutTimerID = setTimeout(this.pollGamepads, intervalMs);
|
||||||
|
|
||||||
// Hijack this button
|
// Hijack this button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user