Change keyboard event target

You can have Phaser listen for keyboard events on the game canvas only (not the browser window).

<canvas autofocus id="canvas" tabindex="0"></canvas>
new Phaser.Game({
  autoFocus: false,
  canvas: canvas,
  type: Phaser.WEBGL,
  input: {
    keyboard: { target: canvas },
    mouse: { preventDefaultDown: false }
  }
  // etc.
});