Handling user input (keyboard, mainly) on Render Texture

Hello!
Based on the initial question “Handling pointer events on Render Texture” ( Handling pointer events on render texture ) I’m wondering how to deal with keyboard events.

I’m rendering a complex UI with buttons and textfields and the code provided in the other thread dealt well with the focus on the textfield element, but when it comes to key events…

Can anyone help me? I’m not very comfortable with user interaction and keyboard stuff. :slight_smile:

Best regards,

Hi!
To summerize:

  • I have a UI presenting textfields.
  • I render that UI to a texture then apply it to a mesh.
  • I capture events and send them to the actual UI.
  • MouseEvent, ClickEvent, FocusEvent and BlurEvent work well

I got a weird behaviour when I register a callback for KeyDownEvent and ChangeEvent:

  • The first key pressed while textfield is focused is sending a KeyDownEvent (twice: keyCode and character, as depicted on this page.
  • Then a ChangeEvent is captured with consistent “previous value” property and an empty “new value” property. Whatever the key pressed. I expected here a change to the value of my key character…
  • From then, all key pressed send KeyDownEvents but no more ChangeEvent is triggered. (Which sounds consistent with the fact the textfield value remains ‘’ thus does not change…)

Can anyone explains why the KeyDownEvent/KeyUpEvent clears the textfield instead of writing content?

Regards,