diff --git a/src/inputs-controller.ts b/src/inputs-controller.ts index a68fcd805..aaf79854c 100644 --- a/src/inputs-controller.ts +++ b/src/inputs-controller.ts @@ -132,6 +132,7 @@ export class InputsController { } gamepadButtonDown(pad: Phaser.Input.Gamepad.Gamepad, button: Phaser.Input.Gamepad.Button, value: number): void { + if (!this.scene.gamepadSupport) return; const actionMapping = this.getActionGamepadMapping(); const buttonDown = actionMapping.hasOwnProperty(button.index) && actionMapping[button.index]; if (buttonDown !== undefined) { @@ -144,6 +145,7 @@ export class InputsController { } gamepadButtonUp(pad: Phaser.Input.Gamepad.Gamepad, button: Phaser.Input.Gamepad.Button, value: number): void { + if (!this.scene.gamepadSupport) return; const actionMapping = this.getActionGamepadMapping(); const buttonUp = actionMapping.hasOwnProperty(button.index) && actionMapping[button.index]; if (buttonUp !== undefined) {