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

Resetting default letter selection of MiniKeyboard

Is there anyway to tell the MiniKeyboard to select a particular text button? I use the MiniKeyboard on my search screen. When I go back a screen, I reset the search screen so it looks like it first did when the user comes back to the search screen. I hide the search results; I set the focus back onto the MiniKeyboard. One other thing I would like to do in order to reset the screen is set the default focused letter to be the upper left and corner letter. 


Is there a way to tell the keyboard to change which letter is in focus?

thanks!
0 Kudos
5 REPLIES 5
joetesta
Roku Guru

Re: Resetting default letter selection of MiniKeyboard

If I'm not mistaken,  miniKeyboard and keyboard don't support setting position programmatically; I think you have two options:
1) re-instantiate each time the screen loads;
m.minikeyboard = createObject("RoSGNode", "miniKeyboard")

  (now it will have default focus position, and all other fields reset to default)

2) create a custom component that acts like minikeyboard but allows programatic control over focus position.
aspiring
0 Kudos
jaxim
Visitor

Re: Resetting default letter selection of MiniKeyboard

Joe:

Re-instantiating a MiniKeyboard works, It's a bit overkill, but it works. I wish brightscript allowed to reset the existing keyboard, but whatever works.

thanks!!!
0 Kudos
joetesta
Roku Guru

Re: Resetting default letter selection of MiniKeyboard

well it's not brightscript that's stopping you but the design of the individual components.  Roku could have included this when they created the pre-built components, but since they didn't, you still have the option to build your own custom component that looks and acts like the miniKeyboard component.  But it's a much bigger pain than re-instantiating, so if this is all you need, that's what I'd do.
aspiring
0 Kudos
jaxim
Visitor

Re: Resetting default letter selection of MiniKeyboard

thanks, Joe!
0 Kudos
necrotek
Roku Guru

Re: Resetting default letter selection of MiniKeyboard

I have not tested with the minikeyboard but for the full sized keyboard that is a part of a keyboard dialog

m.keyboard=m.TOP.createChild("KeyboardDialog")
m.keyboard.buttons=["CONFIRM","CANCEL"]
'...
m.keyboard.focusButton=0 'resets to confirm
m.keyboard.getchild(11).getchild(0).getchild(0).JumpToItem=0 'or animateToItem=0 if you want it to visibly move
0 Kudos