darkraziel

Keyboard input + Microsoft Edge

Recommended Posts

Hi everyone, I just tested the keyboard input examples of Phaser on Microsoft Edge and it doesn't work as it should. Sometimes it won't detect key presses or keep a key pressed down even if I already stopped pressing it. I had the same problem with a game we're developing and I even noticed that some of the old games we've developed have the same problem when testing on Edge.

Has anyone else had this problem? Should I raise it as an issue on the repository?

Share this post


Link to post
Share on other sites

I've just discovered this issue as well. Still no workaround?

Edit: I just found out that the onDown event works correctly on Edge and is a viable alternative. Previously I had a check in update where I listened for pressed input such as:

// if (this.cursorKeys.left.isDown && this.inputReleased) { // do something}

This was bugged for me on Edge as OP described. However, manually assigning an arrow key and triggering an onDown event works okay for me. For example:

this.leftKey = this.game.input.keyboard.addKey(Phaser.Keyboard.LEFT);

And then the binding:

this.leftKey.onDown.add(() => {
    // do something
});

Share this post


Link to post
Share on other sites

After some testing i found out this problem only happens if phaser uses webgl, so if possible set phaser to use canvas on edge and your input should work   

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.