Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
edwardaux
Level 7

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
rftvaa
Level 7

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
Level 7

Re: Focusing on a specific key in keyboard

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