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

Focusing on a specific key in keyboard

We'd like to be able to set initial focus on a specific key in the Keyboard. I can't see any APIs that might offer that functionality. 

I managed to be able to do it by using some extremely dodgy code that looks like:


m.keyboard.getChild(0).getChild(0).jumpToItem = 16



However, this feels like the most brittle solution ever. If Roku ever change the implementation/view hierarchy, things will fall in a heap. Just wanted to check to see if there was a better way.

Cheers,
Craig
m.keyboard.getChild(0).getChild(0).jumpToItem = 16m.keyboard.getChild(0).getChild(0).jumpToItem = 16
0 Kudos
2 REPLIES 2
rftvaa
Visitor

Re: Focusing on a specific key in keyboard

Hi, just replying to say that unfortunately I went with the same solution.

However, you can decrease the changes of getting issues in the future if you recursively explore m.keyboard's children and children's children, etc, looking for the VKBGrid component (which is currently the m.keyboard.getChild(0).getChild(0).subtype() ) and use .jumpToItem if you happen to find it.
0 Kudos
edwardaux
Visitor

Re: Focusing on a specific key in keyboard

Cool, thanks. Nice to know I haven't missed something obvious.
0 Kudos