So I have an EditBox in my project and I would like to run some code when a value has been entered in to the edit box and the player pressed the return button on keyboard.
I’ve been trying to use the Editing Did Ended and Editing Return callback functions, and both do what I need in web platform in the browser, but on native desktop platform I need to click outside the box for it to lose focus to make the event execute and this is not what I want.
I was searching the forum and read docs, but I can’t find any other ways to go about this but Editing Did Ended and Editing Return callbacks but they don’t work as I expected on native platform.
If nothing else, I can add an Enter button and evaluate the value in the box only if the Enter button was pressed, but I am wondering if is there any other ways to check if value was entered in to the box?
I would like the player to be able to just enter the value in to the box, press Return on keyboard and done. I prefer not to force the player to click on an additional button in the scene.
Is there any solution to this?
Using Cocos Creator 2.4.3 on macOS
EditBoxTest.zip (833.2 KB)