Problem with simulator and native.newTextBox

Hi, I’m Edoardo.

I was trying to simulate a simple native.newTextBox but this does not work, click on the box with the mouse does not open the keyboard of the phone.

Also trying the phone, the native.newTextBox does not get up in simultaneous opening of the mobile phone’s keypad and then is hidden, how can I solve this?

Thanks.

This is a problem in the way corona currently handles text input. It is being looked at but there is no ETA on a fix. You have two choices. You can simulate the text box and simulate the keyboard aswell (there are some links in the forums for custom keyboard) or make a native.newTextBox offscreen but you have a problem positioning the cursor. You could ignore the text in the native.newTextBox and just use it to get the native keyboard and handle all the key presses in your simulated textbox. But might have a problem because some keys do not trigger an event. The other way I do it is to have place holder text box (just an image or custom drawn) and on click clear the screen and put the text box on top off the screen to make sure the keyboard doesnt cover it. Also put a post/done button next to it because user can cancel the keyboard and you won’t get an event for that. On post or button press reset the screen.

This is a problem in the way corona currently handles text input. It is being looked at but there is no ETA on a fix. You have two choices. You can simulate the text box and simulate the keyboard aswell (there are some links in the forums for custom keyboard) or make a native.newTextBox offscreen but you have a problem positioning the cursor. You could ignore the text in the native.newTextBox and just use it to get the native keyboard and handle all the key presses in your simulated textbox. But might have a problem because some keys do not trigger an event. The other way I do it is to have place holder text box (just an image or custom drawn) and on click clear the screen and put the text box on top off the screen to make sure the keyboard doesnt cover it. Also put a post/done button next to it because user can cancel the keyboard and you won’t get an event for that. On post or button press reset the screen.