How to avoid emojis in native textbox keyboard input?

As per documentation, We are using below code to avoid emoji’s input. But it is not working.

textBox = native.newTextBox(0,15, 502, 70 );

    

  textBox.hasBackground = false

textBox.font= native.newFont( “HelveticaLT”, 18);

    textBox.inputType =“no-emoji”     

textBox.isEditable= true;

Can you please help us on how to avoid emoji’s chars for textbox?

Thank you.

I dont think you can but I came across some info the other day regarding have to handle them/remove them in code.

I think it had to do with codepage, but alas I do not remember where I saw it.

Sometimes it may be worth extracting the characters you allow from a string instead of removing the ones you dont.

A quick search dug up this one from Rob, maybe it will point you in the right direction.

https://forums.coronalabs.com/topic/34508-emoji-again-no-way-to-recognise-unicode/

I would recommend looking the sample app Interface/NativeKeyboard since it supports the no-emoji mode.

Rob

As far as I know the inputType =“no-emoji” only works for text fields and not text boxes.

I forgot to document the feature but with this plugin: https://marketplace.coronalabs.com/plugin/keyboard-events

You can remove the emoji option from the keyboard by calling:

keyboardEvents.setKeyboardTypeASCIICapable(true)

Do the call after creating the text box.

Excellent! It works perfectly. Thank you for your support

I dont think you can but I came across some info the other day regarding have to handle them/remove them in code.

I think it had to do with codepage, but alas I do not remember where I saw it.

Sometimes it may be worth extracting the characters you allow from a string instead of removing the ones you dont.

A quick search dug up this one from Rob, maybe it will point you in the right direction.

https://forums.coronalabs.com/topic/34508-emoji-again-no-way-to-recognise-unicode/

I would recommend looking the sample app Interface/NativeKeyboard since it supports the no-emoji mode.

Rob

As far as I know the inputType =“no-emoji” only works for text fields and not text boxes.

I forgot to document the feature but with this plugin: https://marketplace.coronalabs.com/plugin/keyboard-events

You can remove the emoji option from the keyboard by calling:

keyboardEvents.setKeyboardTypeASCIICapable(true)

Do the call after creating the text box.

Excellent! It works perfectly. Thank you for your support