OpherV Posted May 24, 2014 Share Posted May 24, 2014 I'm using game.input.keyboard.addKey to capture some input, which works great.However, I'm using some HTML forms for menus, and the keys mapped to phaser don't work in those (because I assume phaser stops the key event propagation). Is there a way to disable the phaser key capture while my form is open and return the key event propagation, then re-enable it when I close my form? I tried myKey.enabled=false, but that only disables the key, it doesn't re-enable it for the browser. Link to comment Share on other sites More sharing options...
OpherV Posted May 25, 2014 Author Share Posted May 25, 2014 So to answer my own question: To disable game capture and return control to the browser-Phaser.Keyboard.removeKeyCapture(myKey.keyCode);myKey.enabled=false;to reenable:Phaser.Keyboard.addKeyCapture(myKey.keyCode);myKey.enabled=true; Link to comment Share on other sites More sharing options...
Recommended Posts