How to automatically pop up the input box in editbox

I have a question, 3.8.1 How to actively pop up the input box. In the old engine, sendActionsForControlEvents was used to actively pop up the keyboard to let the editbox get the focus. Now it seems that the editbox and ccControl have nothing to do with each other. Does anyone know?

1 Like

The textfield I’m using now is very inconvenient. There’s no cursor and the position is wrong. If you have other solutions, please let me know.

My current plan is to add a mask layer on top of the Layer, then add an editBox control, bind the textfield in the UI editor to the editbox through code, and set the data to the textfield when the editbox completes the input. However, the current problem is that after the mask layer pops up, you need to click the editbox again to pop up the input box. The planner thinks this operation is too strange. Can the input box be popped up automatically?

editBox:touchDownAction(editBox, TOUCH_EVENT_ENDED) It turns out that this method can do it…

/**

  • @en Let the EditBox get focus
  • @zh Let the current EditBox get focus.
    /
    setFocus(): void;
    /
    *
  • @en Let the EditBox get focus
  • @zh Let the current EditBox get focus
    /
    focus(): void;
    /
    *
  • @en Let the EditBox lose focus
  • @zh Let the current EditBox lose focus
    */
    blur(): void;
1 Like