Download

TextBox and KeyEvents

Hello everybody,

i am currently working on a VR project where it is needed to type into a MultiLineTextBox (with a real keyboard) but at the same time i would like to capture every key stroke together with the corresponding timestamp.
At the moment i can either capture the key strokes inside the PlayerController or type into the TextBox but not both at the same time. As soon as the TextBox has Keyboard focus there are no more key events appearing in the PlayerController. I did not find a way to hand the events over to the TextBox or anything similar.

I have two solutions in mind:

  1. Change the engine code, so that the key events don’t get digested or maybe route a copy of those key events to my code so i can capture them.
  2. Write my own text logic, so that every key event that occurs in the PlayerController is routed to that text logic, which then creates the whole text out of these events and brings it back into the TextBox via SetText()

Is there something i did not see or take into consideration? Both of these solutions seem pretty hacky to me…
Do you guys have any other suggestions? Any help would be appreciated.

Thank you
theHateful7

If the Textbox is in Slate, they have an OnTextChanged method that is called as the user types. You could use that and then echo out the changes to your PlayerController.