Preventing an initial capital letter in a text field

I see a feature request for this from 4 1/2 years ago but nothing more recent than that, so…

Is there a way to disable a device’s text editor from defaulting to an initial cap in a text field? I have username and password fields that, frankly, don’t need an initial capital letter.

Thanks!

Don’t think you can control the text input interface, but you can force each character input to lower case in your Text Field event listener:

local function textListener( event )
    if ( event.phase == "began" ) then
        -- User begins editing "defaultField"
    elseif ( event.phase == "ended" or event.phase == "submitted" ) then
        -- Output resulting text from "defaultField"
    elseif ( event.phase == "editing" ) then
		-- change text to lower case
		event.target.text = string.lower(event.target.text)
    end
end
2 Likes

Thank you for the response.

I can’t be sure that the username or password doesn’t start with a capital letter, so I wouldn’t want to force it lower case. Seems strange that disabling the initial cap isn’t an option, though.