mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Merge pull request #2471 from cwleonard/gamepad
Gamepad problems in Google Chrome
This commit is contained in:
commit
8da3395407
1 changed files with 10 additions and 0 deletions
|
@ -252,6 +252,11 @@ Phaser.Gamepad.prototype = {
|
|||
*/
|
||||
_pollGamepads: function () {
|
||||
|
||||
if (!this._active)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (navigator['getGamepads'])
|
||||
{
|
||||
var rawGamepads = navigator.getGamepads();
|
||||
|
@ -291,6 +296,11 @@ Phaser.Gamepad.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
for (var g = 0; g < this._gamepads.length; g++)
|
||||
{
|
||||
this._gamepads[g]._rawPad = this._rawPads[g];
|
||||
}
|
||||
|
||||
if (gamepadsChanged)
|
||||
{
|
||||
var validConnections = { rawIndices: {}, padIndices: {} };
|
||||
|
|
Loading…
Reference in a new issue