Jump to content

Minor Issue with Phaser examples


Travis
 Share

Recommended Posts

Oohhh I can help you :D this was a one of my first reports/requests long ago. :)

 

So what you have to do is to tell phaser to stop the event from propagating up to the browser.

 

http://gametest.mobi/phaser/docs/Phaser.Keyboard.html

 

addKeyCapture(keycode)

 

And example how i use it: in function preload() {...}

        var arPreventedKeys = [            Phaser.Keyboard.SPACEBAR,            ,Phaser.Keyboard.UP            ,Phaser.Keyboard.DOWN            ,Phaser.Keyboard.LEFT            ,Phaser.Keyboard.RIGHT        ];        game.input.keyboard.addKeyCapture(arPreventedKeys);

Edit

 

I just saw that your complain is about the examples... well maybe rich should add it to all examples :P

Link to comment
Share on other sites

It's added automatically when you use the addKey command or addCursors (this is in the 1.1.1 release now in master), but otherwise it needs to be set manually yes.

 

I did ought to add it to any other examples not using that approach, although there shouldn't be many. Will sort it out next week, but I'm adamant that the default for Phaser should be that it DOESN'T prevent all keyboard input from propagating.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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