i'm using a native.newTextField to get the name of the user (if he/she wants to enter it). After it's been entered, I'd also like to uppercase the first character (e.g. george -> George)
But .. the cursor/blinker stays on the field even if I click on other buttons, anywhere on the screen etc..
Only if I click on another window (e.g. clicking on a Chrome window when using the simulator) that it disappears and apply the Uppercase feature.
I've tried heaps of things but no luck. At some stage i thought maybe it's a simulator thing, but nope, my samsung tablet has the same problem.
when I go into another screen then I receive "George" rather than "george" but i would like to see it straight away in the menu and also I would like the cursor to stop blinking into the field.
-- currentUser field function lncurrentUser(event) print ("lncurrentUser",event.phase) if ( event.phase == "began" and currentUser.text == "Enter Your Name") then currentUser.text = " " print "cleared currentUser.text" -- event.target.isFocus = true elseif ( event.phase == "ended" or event.phase == "submitted" ) then currentUser.text = string.upper(string.sub(currentUser.text,1,1))..string.sub(currentUser.text,2,string.len(currentUser.text)) -- event.target.text = string.upper(string.sub(currentUser.text,1,1))..string.sub(currentUser.text,2,string.len(currentUser.text)) print ("finished currentUser.text",currentUser.text) -- sceneGroup:insert(currentUser); -- event.target.isFocus = false -- currentUser.isFocus = false -- btn_play.isFocus = true -- currentUser.alpha = 0 ; currentUser.alpha = 1 -- native.setKeyboardFocus( nil ) end