Okay, here are specific and precise instructions, with code snippets, outlining the general pattern for integrating an HTML form with a Phaser 3 game, managing keyboard focus correctly.
This pattern ensures:
- Keyboard input intended for the HTML form (typing, arrow keys for navigation/value changes) works correctly when an input is focused.
- Phaser does not receive or react to keyboard input while the form is being edited.
- Submitting the form (via Enter key or clicking an update button) updates the Phaser game.
- Keyboard focus and control return to the Phaser game after submission.