Turn off auto capitalization of the first letter in a text field (UITextAutocapitalizationTypeNone)

Is it true that corona STILL isn’t supporting this?

textField.autocapitalizationType = UITextAutocapitalizationTypeNone;

I find it almost impossible to believe this, and I have probably misunderstood something…

I’m making a educational app for learning foreign words and I desperately need the ability to NOT automatically capitalize the first entered letter in a text field. Is this not possible at all for iOS builds with Corona?

We have a feature request for this:

http://feedback.coronalabs.com/forums/188732-corona-feature-requests-feedback/suggestions/3594773-ability-to-control-auto-capitalization-keyboard-se

But it only has 51 votes on it. While it seems like it should be a no-brainer, we still have to prioritize it with all the other work we have going. We only have limited engineering hours and you (the community) have a long list of requests.  Encourage more people to vote for this.

Rob

Thanks Rob. I will vote for it

Hi Rob,

Yes, I’ve already voted.

I’m a software developer in a larger organisation, we also have a fairly large support/request queue. From France alone it’s above 22000 now…

Point is, I’m familiar with how a request queue works. We have an in-house practice, however: if it’s an obvious thing (which will benefit many customers) and if it’s easy/fast to implement, we simply just do it. Maybe it’s a stupid thing to, but we’re doing quite well so it’s at least not a company destroying practice…

Just saying… :stuck_out_tongue:

It’s just so damned embarassing  to not be able to do this obvious thing. I have a really hard time defending behavior this to the users.

Not to mention the feature request was back in 2013.

I have a simple system for feature requests in my games… I have 3 folders in Outlook (per game) called “easy”, “medium” and “hard” and that roughly translates into “hours”, “days” and “weeks”.

The problem with the current “get x votes before we look at it” systems means that often easy wins like this just get ignored.

Agree.

I’m asking engineering about it. It can’t be implemented in a cross-platform way. If we did, it would be iOS only. I believe as a community, you would likely be happy with this being an iOS-only feature.

Rob

Well, since it’s an iOS only problem (at last it is for me), an iOS only feature is completely ok by me.

Rob, did you get any answers from the engineering about the feasibility of this?

They said, there are cross-platform issues with it. I said the community would appreciate it even if it was iOS only. Right now Engineering’s workload is full with must-do projects and this is something I’ll need to bring back up at some point in the future.

Rob

Ok, thanks for the effort anyway, Rob!

@runewinse

I just added the option to set autocapitalizationType on native text fields and text boxes (iOS only) using this plugin:

https://marketplace.coronalabs.com/corona-plugins/keyboard-events

Do like this:

local keyboardEvents = require "plugin.keyboardEvents" -- Call this for text fields  keyboardEvents.setTextFieldAutocapitalizationType("None") -- Call this for text boxes  keyboardEvents.setTextBoxAutocapitalizationType("None")

Both methods takes one of the following options: “None”, “Words”, “Sentences” or “AllCharacters”

The autocapitalization type will be set on all instances of text boxes or text fields in your app.

If you need different autocapitalization types on different text fields you can switch the type in the began phase of the individual textInputListeners.

@ojnab

Wow! I will check out your plug-in as soon as I get home this evening!

Takker og bukker!  :slight_smile:

Ok, I’ve testet a bit and I don’t get it to work. It’s quite possible me who have done something wrong.

When I touch a text field, the keyboard shows up and the keys are all uppercase (since it’s the first letter in the text field), just as before:

Video:

https://youtu.be/dQMUsipTrBA

I guess if things were working as supposed to, the keyboard would show all lowercase letters?

What I’ve done is this:

main.lua:

local keyboardEvents = require "plugin.keyboardEvents" -- Turn off auto capitalization for text fields and text boxes (only for iOS) keyboardEvents.init() keyboardEvents.setTextFieldAutocapitalizationType("None") keyboardEvents.setTextBoxAutocapitalizationType("None") keyboardEvents.setAutocorrectionType("UITextAutocorrectionTypeNo") keyboardEvents.setSpellCheckingType("UITextAutocorrectionTypeNo")

I added setAutocorrectionType() and setSpellCheckingType() for good measure. 

I also called init() first.

I also added the following line under the plugins section in build.settings:

["plugin.keyboardEvents"] = { publisherId = "net.shakebrowser" },

Do you see any obvious errors in the usage?

Maybe I should try this instead (as this is how I require the other plugins that I use)?

local keyboardEvents = require("plugin.keyboardEvents")

Nah…last version didn’t make any difference (as I suspected).

BTW, I’m testing on a iPhone 5S running iOS 11.2.6

You need to do the calls after creating your text fields/boxes. Something like this:

local textField = native.newTextField( 150, 50, 180, 30 ) keyboardEvents.setTextFieldAutocapitalizationType("None")

Or if you need to change the  autocapitalization type on different text fields you can set it in the began phase of the listener like this:

local function textListener( event )    if ( event.phase == "began" ) then         keyboardEvents.setTextFieldAutocapitalizationType("None")     end end local textField = native.newTextField( 150, 50, 180, 30 ) textField:addEventListener( "userInput", textListener )

Er du fra danmark siden du takker og bukker  :slight_smile:

Ok, so there is no harm calling setTextFieldAutocapitalizationType() mutiple times then (like after every call to newTextField() ) ?

Because it’s very hard to know when the last call to newTextField() is done…

I’ll check this out right now!

Jeg er nok hva dere kaller en “fjeldabe”…  :slight_smile:

No harm in doing that.

Godt at høre at der er fjeldaber i forummet også  :smiley: