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: 
NewManLiving
Visitor

keyboard code example

As sort of a challenge I decided to write an all-code keyboard with all the bells and whistles. Well it turned out to be more complex than I anticipated, mainly due to the use of multiple banks of characters and animation of the selector. I used the ROKU main keyboard ( the one for selecting a network ) as a model. I am sure that I did not get all of the character codes correct, but that can be easily remedied by changing the ascii value at the proper bank index. It has as much functionality as I could possibly stick into it, complete with continuous delete and cursor movement, simply by holding down those keys. Since it is bitmap free and has to draw in each of the six banks depending upon what is selected in the right panel, it is large and looks intimidating code-wise. But it is very well commented and can serve as a reference to those who are interested in creating their own keyboards. I tested it as much as possible and I believe I got most of the bugs out ( hopefully all ). All the usual keys are used to operate it, including the fast-forward/reverse to move the selector quickly from one area to another. You can download if you wish from the link below. This link is dedicated to the forum examples. It incorporates a mini-framework that can be studied to create your own consistent framework. This is important in an all-code environment such as the 2D, You can quickly get lost otherwise. It is already zipped and ready to be side-loaded. If you discover bugs or make improvements, please share them. If you have problems downloading the zip let me know. The DEBUG variable is True in main, so any errors will print out to the console by default





https://nml_forum_production.s3.amazonaws.com/keyboard/out/keyboard.zip
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
2 REPLIES 2
belltown
Roku Guru

Re: keyboard code example

Looks nice! However, I had to bypass your channel_is_device_supported() code so I could run it on my SD TV, but it seems to work well.
0 Kudos
NewManLiving
Visitor

Re: keyboard code example

That code is a carry over from my demo channel. The keyboard should scale properly in SD there are no bitmaps to load and the roScreen is set up to scale. Left the code there as an example and hopefully some input as to a better way to determine the host device. Since I use AA objects exclusively, it's easy just to set function pointers to the specific routines optimized for a particular device in the initialization function of each object.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
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.