File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,24 +190,26 @@ Phaser.SinglePad.prototype = {
190190
191191 for ( var i = 0 ; i < this . _buttonsLen ; i ++ )
192192 {
193- if ( this . _rawPad . buttons [ i ] . value !== this . _buttons [ i ] . value )
193+ var rawButtonVal = isNaN ( this . _rawPad . buttons [ i ] ) ? this . _rawPad . buttons [ i ] . value : this . _rawPad . buttons [ i ] ;
194+
195+ if ( rawButtonVal !== this . _buttons [ i ] . value )
194196 {
195- if ( this . _rawPad . buttons [ i ] . value === 1 )
197+ if ( rawButtonVal === 1 )
196198 {
197- this . processButtonDown ( i , this . _rawPad . buttons [ i ] . value ) ;
199+ this . processButtonDown ( i , rawButtonVal ) ;
198200 }
199- else if ( this . _rawPad . buttons [ i ] . value === 0 )
201+ else if ( rawButtonVal === 0 )
200202 {
201- this . processButtonUp ( i , this . _rawPad . buttons [ i ] . value ) ;
203+ this . processButtonUp ( i , rawButtonVal ) ;
202204 }
203205 else
204206 {
205- this . processButtonFloat ( i , this . _rawPad . buttons [ i ] . value ) ;
207+ this . processButtonFloat ( i , rawButtonVal ) ;
206208 }
207209 }
208210 }
209211
210- /*
212+
211213 for ( var j = 0 ; j < this . _axesLen ; j ++ )
212214 {
213215 var axis = this . _rawPad . axes [ j ] ;
@@ -221,7 +223,6 @@ Phaser.SinglePad.prototype = {
221223 this . processAxisChange ( { axis : j , value : 0 } ) ;
222224 }
223225 }
224- */
225226
226227 this . _prevTimestamp = this . _rawPad . timestamp ;
227228
You can’t perform that action at this time.
0 commit comments