Hey everyone !
With VR in mind, i managed to get my (very complex) UI working on a UWidgetComponent and i’m very happy with it (fantastic work from epic dev team as always, thanks a lot !!).
Now there’s still one thing i need for it to be fully working with a DK2 on my head, and that’s the keyboard.
I need it to write into some SEditableText, for instance for players to change their name.
So i’m considering the options/strategies i could adopt. So, let’s take the “A” key, i need a button that can send an A into an editable text.
The brute force strategy would be something along:
When the A button is pressed:
- note which SEditableText has the focus (because the UMG keyboard will take it when pressed)
- put its content in a string
- add an A at the end of the string
- put the string back in the SEditableText.
- give the focus back to the SEditableText.
This should work but seems a bit over complicated.
A much more elegant way would be to have some function that would say to the button “when pressed, do not take the focus and send exactly the same message as if the A key of the real physical keyboard had been pressed”.
So when i would press the slate button, it would write an A naturally in the selected SEditableText.
Is there a way to do that ?
Or maybe there’s some simpler/better strategy that i did not think of ? Like using the android virtual keyboard in a desktop game ? (i am developping for windows by the way)
Or anything even simpler that will put me to shame for posting this tread ??
Anyone with experience in this area before i try to reinvent the wheel ?