Skip to content

Commit

Permalink
The InputPlugin will now dispatch an update event regardless, allowin…
Browse files Browse the repository at this point in the history
…g the Gamepad Plugin to update itself every frame, regardless of DOM events. This allows Gamepads to work correctly again. Fix #4414
  • Loading branch information
photonstorm committed Apr 8, 2019
1 parent f552dde commit 0cfbc79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -104,6 +104,7 @@ Notes:
* Calling `Tween.restart` multiple times in a row would cause the tween to freeze. It will now disregard all additional calls to `restart` if it's already in a pending state (thanks @rgk)
* Tween Timelines would only apply the `delay` value of a child tween once and not on loop. Fix #3841 (thanks @Edwin222 @Antriel)
* `Texture.add` will no longer let you add a frame to a texture with the same name or index as one that already exists in the texture. Doing so will now return `null` instead of a Frame object, and the `frameTotal` will never be incremented. Fix #4459 (thanks @BigZaphod)
* The InputPlugin will now dispatch an update event regardless, allowing the Gamepad Plugin to update itself every frame, regardless of DOM events. This allows Gamepads to work correctly again. Fix #4414 (thanks @CipSoft-Components)

### Examples, Documentation and TypeScript

Expand Down
8 changes: 2 additions & 6 deletions src/input/InputPlugin.js
Expand Up @@ -399,11 +399,7 @@ var InputPlugin = new Class({
eventEmitter.on(SceneEvents.TRANSITION_OUT, this.transitionOut, this);
eventEmitter.on(SceneEvents.TRANSITION_COMPLETE, this.transitionComplete, this);
eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this);

if (this.manager.useQueue)
{
eventEmitter.on(SceneEvents.UPDATE, this.update, this);
}
eventEmitter.on(SceneEvents.UPDATE, this.update, this);

eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);

Expand Down Expand Up @@ -544,7 +540,7 @@ var InputPlugin = new Class({
return;
}

var runUpdate = (manager.dirty || this.pollRate === 0);
var runUpdate = (manager.dirty || this.pollRate === 0 || manager.useQueue);

if (this.pollRate > -1)
{
Expand Down

0 comments on commit 0cfbc79

Please sign in to comment.