Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hayewood
Channel Surfer

How can I receive a callback for character input from the iOS / Android roku keyboards?

My original intuition was that I would get these events in keySelected when extending DynamicCustomKeyboard. This was not the case. This event is only called when on screen keys are pressed. Not from the iOS / Android keyboard. Any ideas? My original goal is to block all non-alphanumeric text from updating the text view.

0 Kudos
3 REPLIES 3
hayewood
Channel Surfer

Disable special characters from iOS / android app keyboard dialog

I would like to restrict users from being able to type any special characters (i.e. $%^&) in my DynamicCustomKeyboard from the iOS / Android roku remote keyboard. My DynamicCustomKeyboard only allows for alphanumeric values, but when used on the roku mobile app keyboard, users can type any character possible. How can I allow only alphanumeric values? Channels like Hulu and Tubi have this feature

 
 
0 Kudos
RokuJonathanD
Community Moderator
Community Moderator

Re: How can I receive a callback for character input from the iOS / Android roku keyboards?

Hi @hayewood,

When you use a keyboard on a mobile device, in general, selecting any character key causing that character to be added at the cursor position to the string in the TextEditBox without any filtering as to whether or not the keyboard on the screen supports the entry of that character. 

This is true for both the old keyboards and the new dynamic keyboards.

You can try to observe the DynamicKeyboardBase.textField and, each time it changes, remove any unwanted characters, although it's possible that the user would briefly see the character before it is removed.

hayewood
Channel Surfer

Re: How can I receive a callback for character input from the iOS / Android roku keyboards?

Thank you for the reply! I did notice that the MiniKeyboard type does in fact change the keyboard on iOS apps to an alphanumeric keyboard. Not sure about Android. Is there a possibility this feature will be extended to the new Dynamic keyboards such as DynamicMiniKeyboard or DynamicCustomKeyboard? Thanks!

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.