event.startPosition

Type Number
Event userInput
Revision Current Public Release (2018.3326)
Keywords userInput, startPosition

Overview

The position where the cursor was when the event took place.

Gotchas

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

Example

local function textListener( event )
    if ( event.phase == "editing" ) then
        print( event.startPosition )
    end
end
 
defaultField = native.newTextField( 150, 150, 180, 30 )
defaultField:addEventListener( "userInput", textListener )