I made a text input that saves to file today, which I just learned how to do. I actually asked about it, and then answered myself here: http://forums.coronalabs.com/topic/54761-text-input-to-file/?p=284789
Long part:
Now that i have it in place, and I can edit all 10 of my fields with whatever message I like, I have come across one small issue.
When I am “Editing” or my cursor is active in a box, and I close my overlay window, then the message for that field does not update.
This effectively means that one of my fields will be left blank, no matter how you add text to them.
I use a Kindle Fire Gen 1 to test my apps, as I do not actually own a phone. ;)
I do not see a “Enter/Return” button on my keyboard.
Short part:
I would like to be able to “Submit” my text fields when i hit my “Hide Overlay Button”
Here is one input block of code:
local input1 -- Create text field input1 = native.newTextField( display.contentCenterX, 95, display.contentWidth-50, 30 ) input1.placeholder = myData.msg1 sceneGroup:insert( input1 ) local function textListener1( event ) if ( event.phase == "began" ) then -- user begins editing defaultField print( event.text ) elseif ( event.phase == "ended" or event.phase == "submitted" ) then -- do something with defaultField text print( event.target.text ) myData.msg1 = input1.text input1.placeholder = myData.msg1 elseif ( event.phase == "editing" ) then print( event.newCharacters ) print( event.oldText ) print( event.startPosition ) print( event.text ) end end input1:addEventListener( "userInput", textListener1 )
Thanks!
Tyler