Native Textfield Questions

Hi there,

I’ve just started messing around with the native textfield to see if it’s going to be suitable for use in one of our apps. I wonder if anyone knows the answer to the following…

  1. Is there a way of adapting the keyboard to allow entry of extra characters (french, german characters with accents for example)? At present I can only get it to switch from English UK to US to emojis… by pressing the globe button on the iOS keyboard that appears. I wanted ideally to just allow certain foreign characters.

  2. Is there a way of disabling spellcheck and dictation? The app in question is a spelling app for children, so having a spellcheck that tells them how to spell the words they’re being tested on or allowing them to dictate the words kind of defeats the purpose!

At present we have our own custom keyboard we wrote ourselves but the issue I have is that doesn’t work with external keyboards i.e. the new iPad Pro keyboard. It’s looking like we can’t have both a custom keyboard and linkup with external keyboards but I’m hoping there is a solution.

Thanks,

Ian

Hi Ian,

For #1, I don’t believe we’re doing anything unusual with keyboard languages/characters. The OS controls what is available via the device’s language and keyboard setup… we’re just linking up the native keyboard with text input fields.

For #2, you can change various spell/autocorrect params on iOS via these (but I’m not sure about “dictation”:

https://docs.coronalabs.com/api/type/TextField/autocorrectionType.html

https://docs.coronalabs.com/api/type/TextField/spellCheckingType.html

As for implementing your own keyboard, I’m a little confused on how you’d like it all to function. If you have your own custom on-screen keyboard assembled through Corona display objects (I assume), then you want the external physical keyboard to somehow interact with that onscreen keyboard, which then in turn does something to a native text input field? Or does your custom keyboard do something else unrelated to native text input?

Best regards,

Brent

HI Brent,

Thanks as always for your reply.

Basically what I want to achieve is as follows:

I have a custom made keyboard and custom input box created using Corona display objects - buttons for each key and a simple graphic for the input box. My keyboard features standard English characters / numbers and a second screen with a series of French, German, Spanish characters etc. It works great, but it won’t function with the external keyboard that the iPad Pro has. I can find no way of linking the input from that to my custom keyboard and I believe at the moment it isn’t possible directly. A number of our users have asked if we can add support for the external keyboard.

So, someone suggested I use native textfields instead of my custom solution (as they work with the external keyboard), but the problem with those is that they feature a whole load of characters I don’t need and don’t seem to feature some of the ones I do need. This app is aimed at young children, so having a load of superfluous characters in the keyboard is annoying and likely to cause confusion. The native textfields also bring up spellcheck etc. and an option for using dictation to enter content into the textfield.

I’m therefore looking for a way to turn off the spellcheck and autocorrect (which you’ve kindly linked to above, so thanks for that) but also turn off dictation and customise the characters that are displayed on the keyboard or at the very least offer the foreign characters I need to offer for French / German / Spanish users.

I’m not sure there’s a way to get everything I want. The ideal would be for you guys to support input from external keyboards so I could just use my current custom solution with the external keyboards and not worry about the native textfields. I’ve filed this as a feature request but I appreciate there are a million other things in the pipeline too.

Thanks,

Ian

On my iPhone, if I hold down my press on certain letters like the vowels, it will come up with a popup that lets you get to the accents and emulates and such which is how I enter non-ASCII characters. This should work with native.newTextFields().

Rob

Hi Rob,

Thanks - yes - I was hoping for a way to have them displayed permanently. I don’t think it’s possible unfortunately.

I think we’ll have to stick with what we have and delay support for any external keyboards until (if) Corona can support input from external devices without the need for the native textfields.

Cheers,

Ian

Hi Ian,

Could you put the native text field off screen, detect which key it recieved, pass that value on to your “custom” keyboard, and then act like that pseudo-key was pressed? I know that’s a fairly convoluted approach, but it might do the trick. :slight_smile:

Brent

Hi Ian,

For #1, I don’t believe we’re doing anything unusual with keyboard languages/characters. The OS controls what is available via the device’s language and keyboard setup… we’re just linking up the native keyboard with text input fields.

For #2, you can change various spell/autocorrect params on iOS via these (but I’m not sure about “dictation”:

https://docs.coronalabs.com/api/type/TextField/autocorrectionType.html

https://docs.coronalabs.com/api/type/TextField/spellCheckingType.html

As for implementing your own keyboard, I’m a little confused on how you’d like it all to function. If you have your own custom on-screen keyboard assembled through Corona display objects (I assume), then you want the external physical keyboard to somehow interact with that onscreen keyboard, which then in turn does something to a native text input field? Or does your custom keyboard do something else unrelated to native text input?

Best regards,

Brent

HI Brent,

Thanks as always for your reply.

Basically what I want to achieve is as follows:

I have a custom made keyboard and custom input box created using Corona display objects - buttons for each key and a simple graphic for the input box. My keyboard features standard English characters / numbers and a second screen with a series of French, German, Spanish characters etc. It works great, but it won’t function with the external keyboard that the iPad Pro has. I can find no way of linking the input from that to my custom keyboard and I believe at the moment it isn’t possible directly. A number of our users have asked if we can add support for the external keyboard.

So, someone suggested I use native textfields instead of my custom solution (as they work with the external keyboard), but the problem with those is that they feature a whole load of characters I don’t need and don’t seem to feature some of the ones I do need. This app is aimed at young children, so having a load of superfluous characters in the keyboard is annoying and likely to cause confusion. The native textfields also bring up spellcheck etc. and an option for using dictation to enter content into the textfield.

I’m therefore looking for a way to turn off the spellcheck and autocorrect (which you’ve kindly linked to above, so thanks for that) but also turn off dictation and customise the characters that are displayed on the keyboard or at the very least offer the foreign characters I need to offer for French / German / Spanish users.

I’m not sure there’s a way to get everything I want. The ideal would be for you guys to support input from external keyboards so I could just use my current custom solution with the external keyboards and not worry about the native textfields. I’ve filed this as a feature request but I appreciate there are a million other things in the pipeline too.

Thanks,

Ian

On my iPhone, if I hold down my press on certain letters like the vowels, it will come up with a popup that lets you get to the accents and emulates and such which is how I enter non-ASCII characters. This should work with native.newTextFields().

Rob

Hi Rob,

Thanks - yes - I was hoping for a way to have them displayed permanently. I don’t think it’s possible unfortunately.

I think we’ll have to stick with what we have and delay support for any external keyboards until (if) Corona can support input from external devices without the need for the native textfields.

Cheers,

Ian

Hi Ian,

Could you put the native text field off screen, detect which key it recieved, pass that value on to your “custom” keyboard, and then act like that pseudo-key was pressed? I know that’s a fairly convoluted approach, but it might do the trick. :slight_smile:

Brent