Jump to content

UWP JavaScript keyboard bug


artsailor
 Share

Recommended Posts

I'm developing simple game in TypeScript and HTML5 using Phaser. It is targeting to all major platforms (Android, IOS and UWP) and standalone web page. I've added basic keyboard implementation for player movement using Phaser engine implementation :
this.leftKey = this.game.input.keyboard.addKey(Phaser.Keyboard.LEFT);
this.rightKey = this.game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); 
and after testing I've noticed strange input behavior in UWP native solution. The keyboard seems to lag.
After searching solution I find this page https://docs.microsoft.com/en-us/windows/uwp/get-started/get-started-tutorial-game-js3d  where I find recommended keyboard support in UWP apps using JavaScript (chapter 5 Adding player movement) . 
document.addEventListener('keydown', this.onKeyDown.bind(this), false);
document.addEventListener('keyup', this.onKeyUp.bind(this), false);
But after implementing it the problem still exist. Application seems not respond for events immediately, don't getting events at all or getting it in wrong order. This situation is occurs only in UWP app, in all other platforms movement works great.
I even downloaded and test game from link above and noticed the same keyboard issues. 
Does anyone know solution to  this problem or what causes it? 
Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...