GUI Input Field & keypressEvent?

Hey guys,
actually i face a challenge, that I think might be easy to one of you :slight_smile:

I developed a scene, that contains a GUI Input Dialog that enables a user to name my meshes - BUT it is required to press the “OK” Button to do so. I also wrote a short keyboard Routine, that should enable the User simply to press “Enter” to add the Name Label to a certain mesh - but hze has to press “Enter” twice to do so. The problem has something to do with focus - it seemes that when a User clicks on the Input field the Field, instead of the scene gains the focus - which is completley clear. If the User presses “Enter” focus is set to scene again, when he presses “Enter” again my routine starts.

So my question is simply: Is there a way to add the onKeyDownObersevable to the Inputfield instead of the scene?

Sincerly Yours,

onBeforeKeyAddObservable on the inputText shoudl be perfect for this

1 Like