Hi guys,
I notice that for ‘newTextBox’, the listener does not get triggered when the field is selected (in Mac simulator Version 2013.2114 (2013.12.28) ). The expected result is ‘event.phase = began’ to be triggered when the field is selected.
But the ‘event.phase = began’ is only shown when something is typed into the text box It will also show ‘event.phase = editing’ at the same time, since it is also editing.
The ‘newTextField’ is working fine.
Sample Code (taken from the sample codes) :
local function fieldHandler( textField ) return function( event ) print(event.phase) if ( "began" == event.phase ) then -- This is the "keyboard has appeared" event -- In some cases you may want to adjust the interface when the keyboard appears. elseif ( "ended" == event.phase ) then -- This event is called when the user stops editing a field: for example, when they touch a different field elseif ( "editing" == event.phase ) then elseif ( "submitted" == event.phase ) then -- This event occurs when the user presses the "return" key (if available) on the onscreen keyboard print( "Input : " .. textField().text ) -- Hide keyboard native.setKeyboardFocus( nil ) end end end defaultField = native.newTextBox( 10, 30, 180, tHeight ) defaultField.isEditable = true defaultField.font = native.newFont( native.systemFontBold, inputFontSize ) defaultField:addEventListener( "userInput", fieldHandler( function() return defaultField end ) )