Sfoglia il codice sorgente

Merge pull request #6534 from MackeyK24/master

Fix Xbox One Controller Buttons
David Catuhe 6 anni fa
parent
commit
eb09ac5cd5
2 ha cambiato i file con 11 aggiunte e 10 eliminazioni
  1. 1 0
      dist/preview release/what's new.md
  2. 10 10
      src/Gamepads/xboxGamepad.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -72,6 +72,7 @@
 - Added a note on shallow bounding of getBoundingInfo ([tibotiber](https://github.com/tibotiber))
 
 ## Bug fixes
+- Fixed Xbox One gamepad controller button schemes ([MackeyK24](https://github.com/MackeyK24/))
 - Added support for `AnimationGroup` serialization ([Drigax](https://github.com/drigax/))
 - Removing assetContainer from scene will also remove gui layers ([TrevorDev](https://github.com/TrevorDev))
 - A scene's input manager not adding key listeners when the canvas is already focused ([Poolminer](https://github.com/Poolminer))

+ 10 - 10
src/Gamepads/xboxGamepad.ts

@@ -410,16 +410,16 @@ export class Xbox360Pad extends Gamepad {
             this.buttonY = this.browserGamepad.buttons[3].value;
             this.buttonLB = this.browserGamepad.buttons[4].value;
             this.buttonRB = this.browserGamepad.buttons[5].value;
-            this.leftTrigger = this.browserGamepad.axes[2];
-            this.rightTrigger = this.browserGamepad.axes[5];
-            this.buttonBack = this.browserGamepad.buttons[9].value;
-            this.buttonStart = this.browserGamepad.buttons[8].value;
-            this.buttonLeftStick = this.browserGamepad.buttons[6].value;
-            this.buttonRightStick = this.browserGamepad.buttons[7].value;
-            this.dPadUp = this.browserGamepad.buttons[11].value;
-            this.dPadDown = this.browserGamepad.buttons[12].value;
-            this.dPadLeft = this.browserGamepad.buttons[13].value;
-            this.dPadRight = this.browserGamepad.buttons[14].value;
+            this.leftTrigger = this.browserGamepad.buttons[6].value;
+            this.rightTrigger = this.browserGamepad.buttons[7].value;
+            this.buttonBack = this.browserGamepad.buttons[8].value;
+            this.buttonStart = this.browserGamepad.buttons[9].value;
+            this.buttonLeftStick = this.browserGamepad.buttons[10].value;
+            this.buttonRightStick = this.browserGamepad.buttons[11].value;
+            this.dPadUp = this.browserGamepad.buttons[12].value;
+            this.dPadDown = this.browserGamepad.buttons[13].value;
+            this.dPadLeft = this.browserGamepad.buttons[14].value;
+            this.dPadRight = this.browserGamepad.buttons[15].value;
         } else {
             this.buttonA = this.browserGamepad.buttons[0].value;
             this.buttonB = this.browserGamepad.buttons[1].value;