We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
mozGetGamepads
webkitGetGamepads
1 parent 4679796 commit d3432e7Copy full SHA for d3432e7
src/lib/libsdl.js
@@ -1349,12 +1349,10 @@ var LibrarySDL = {
1349
},
1350
1351
getGamepads() {
1352
- var fcn = navigator.getGamepads || navigator.webkitGamepads || navigator.mozGamepads || navigator.gamepads || navigator.webkitGetGamepads;
1353
- if (fcn !== undefined) {
1354
- // The function must be applied on the navigator object.
1355
- return fcn.apply(navigator);
+ if (!navigator.getGamepads) {
+ return [];
1356
}
1357
- return [];
+ return navigator.getGamepads();
1358
1359
1360
// Helper function: Returns the gamepad if available, or null if not.
0 commit comments