Getting text input from a user

Hello all.
I want to implement player chat into my game. As such, I need some way to receive text input from the user.

Now, the text they enter will be displayed by writing it to an overlaying SVG, but I see a few methods to get what the player is writing:

  1. Overlay an HTML element that steals focus.
  2. Parse keystrokes inside playcanvas
  3. Something else

Have people done this previously. If so, how? What is the recomended method?

  1. You can use <input> tag on HTML.
  2. You can use keydown event and get char-code of key as keydownevent.event.keyCode
1 Like

this project has something like that