File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,22 +10,30 @@ var Input = {
1010 mspointer : false ,
1111
1212 // @property {?string } wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll'
13- wheelEvent : null
13+ wheelEvent : null ,
14+
15+ // @property {boolean } gamepads - Is navigator.getGamepads available?
16+ gamepads : false
1417
1518} ;
1619
1720function init ( )
1821{
19- if ( 'ontouchstart' in document . documentElement || ( window . navigator . maxTouchPoints && window . navigator . maxTouchPoints >= 1 ) )
22+ if ( 'ontouchstart' in document . documentElement || ( navigator . maxTouchPoints && navigator . maxTouchPoints >= 1 ) )
2023 {
2124 Input . touch = true ;
2225 }
2326
24- if ( window . navigator . msPointerEnabled || window . navigator . pointerEnabled )
27+ if ( navigator . msPointerEnabled || navigator . pointerEnabled )
2528 {
2629 Input . mspointer = true ;
2730 }
2831
32+ if ( navigator . getGamepads )
33+ {
34+ Input . gamepads = true ;
35+ }
36+
2937 if ( ! OS . cocoonJS )
3038 {
3139 // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ var GamepadManager = new Class({
3434 {
3535 var config = this . manager . config ;
3636
37- this . enabled = config . inputGamepad ;
37+ this . enabled = config . inputGamepad && this . manager . game . device . Input . gamepads ;
3838
3939 this . target = window ;
4040
You can’t perform that action at this time.
0 commit comments