event.newCharacters

Type String
Event userInput
Revision Release 2024.3703
Keywords userInput, newCharacters

Overview

New characters that were typed in for the event.

Gotchas

This property is only available during the "editing" phase of userInput events.

Example

local defaultField

local function textListener( event )
    if ( event.phase == "editing" ) then
        print( event.newCharacters )
    end
end

defaultField = native.newTextField( 150, 150, 180, 30 )
defaultField:addEventListener( "userInput", textListener )