jasper1990 Posted June 5, 2017 Share Posted June 5, 2017 I am developing my own login textfield within phaser. what is the best way to listen on all the keyboard keys? From the examples, I know you can do something like this : game.input.keyboard.isDown(Phaser.Keyboard.LEFT) Though, it is not elegant to use this for every keycode. any advice? Link to comment Share on other sites More sharing options...
Skeptron Posted June 5, 2017 Share Posted June 5, 2017 Are you sure this does not to the job? Avoid wasting time on such things! Link to comment Share on other sites More sharing options...
squilibob Posted June 24, 2017 Share Posted June 24, 2017 game.input.keyboard.addCallbacks(this, null, null, this.handleKey); this.handleKey = function(char) { //char will be the keypressed, you can check a range or use a switch statement here } Link to comment Share on other sites More sharing options...
Recommended Posts