mirror of
https://github.com/photonstorm/phaser
synced 2024-11-29 16:10:56 +00:00
Merge branch 'master' of https://github.com/photonstorm/phaser
This commit is contained in:
commit
f974dd7a7e
1 changed files with 12 additions and 1 deletions
|
@ -167,6 +167,16 @@ var KeyboardPlugin = new Class({
|
|||
*/
|
||||
this.prevTime = 0;
|
||||
|
||||
/**
|
||||
* Internal repeat key flag.
|
||||
*
|
||||
* @name Phaser.Input.Keyboard.KeyboardPlugin#prevType
|
||||
* @type {string}
|
||||
* @private
|
||||
* @since 3.50.1
|
||||
*/
|
||||
this.prevType = null;
|
||||
|
||||
sceneInputPlugin.pluginEvents.once(InputEvents.BOOT, this.boot, this);
|
||||
sceneInputPlugin.pluginEvents.on(InputEvents.START, this.start, this);
|
||||
},
|
||||
|
@ -747,7 +757,7 @@ var KeyboardPlugin = new Class({
|
|||
}
|
||||
|
||||
// Duplicate event bailout
|
||||
if (code === this.prevCode && event.timeStamp === this.prevTime)
|
||||
if (code === this.prevCode && event.timeStamp === this.prevTime && event.type === this.prevType)
|
||||
{
|
||||
// On some systems, the exact same event will fire multiple times. This prevents it.
|
||||
continue;
|
||||
|
@ -755,6 +765,7 @@ var KeyboardPlugin = new Class({
|
|||
|
||||
this.prevCode = code;
|
||||
this.prevTime = event.timeStamp;
|
||||
this.prevType = event.type;
|
||||
|
||||
if (event.type === 'keydown')
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue