Forum Discussion

edwardaux's avatar
edwardaux
Visitor
8 years ago

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
  • 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.