mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +00:00
Recoded Gamepad detection to stop it breaking on FF.
This commit is contained in:
parent
c025b95959
commit
1d428a7ca4
1 changed files with 12 additions and 1 deletions
|
@ -226,7 +226,18 @@ Phaser.Gamepad.prototype = {
|
|||
*/
|
||||
_pollGamepads: function () {
|
||||
|
||||
var rawGamepads = navigator.getGamepads() || (navigator.webkitGetGamepads && navigator.webkitGetGamepads()) || navigator.webkitGamepads;
|
||||
if (navigator['getGamepads'])
|
||||
{
|
||||
var rawGamepads = navigator.getGamepads();
|
||||
}
|
||||
else if (navigator['webkitGetGamepads'])
|
||||
{
|
||||
var rawGamepads = navigator.webkitGetGamepads();
|
||||
}
|
||||
else if (navigator['webkitGamepads'])
|
||||
{
|
||||
var rawGamepads = navigator.webkitGamepads();
|
||||
}
|
||||
|
||||
if (rawGamepads)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue