Text Field set to active automatically

Hi,

I have a basic Node with a TextField child…
How do i make the text field automatically active when I set the Node visible, so that you don’t need to tap on the textfield then type? Just type right away when the Node is set to visible(true).

Thanks!

You can use TextField::attachWithIME() to open the keyboard programatically.

If you want to tie this to visible state and you can’t can’t call attachWithIME() after setVisible(true), then I would suggest subclassing TextField and overriding Node::setVisible().

1 Like

I did txtField1->attachWithIME();
and wow that did it. Didn’t know my problem was this simple! Beginner c++ programmer here…
Thank you very much for your help!