Gab648 Posted February 29, 2016 Share Posted February 29, 2016 Hi, I want to allow a key that was added with "theKey = game.input.keyboard.addKey(Phaser.Keyboard.A)" to be propagated up to the browser without having to remove the key capture with "game.input.keyboard.removeKeyCapture(Phaser.Keyboard.A)". I want to do this because on the page where the Phaser window is, there is also a comment section where those letters actually can not be typed. I do not want to remove key capture because then I will need to use "theKey.onDown.add(function)" and this function will only be called one time ( I want the key to repeat some action as long as it is pressed down ). Here is the said project, where the key "A", named "p1.leftKey", is used to move the first player's canon ( as you can see on line 448 in the script.js file : "if(p1.leftKey.isDown){p1.canon.rotation -= 0.02;}", wich is in the update function ). script.js Link to comment Share on other sites More sharing options...
AzraelTycka Posted March 1, 2016 Share Posted March 1, 2016 Hello, basically you want to keep keyCapture but you also don't want to keep key capture? That's what I got from your post :-). Kind of hard to do both at the same time considering they are exlusive. There are some other posts (I remember this one which leads to another one if needed) which are tackling the same problem as you have just encountered feel free to go throug them, possible solution is there somewhere too. Link to comment Share on other sites More sharing options...
Gab648 Posted March 6, 2016 Author Share Posted March 6, 2016 Thank you very much ! This very short and simple post solved my problem . Link to comment Share on other sites More sharing options...
Recommended Posts