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

ZoomRowList never loses focus?

I've set the zoomRowList so `wrap="false"`.
When I get to the top of the zoomRowList, the onKeyEvent() doesn't get triggered. How do I get the onKeyEvent() to trigger so I know that the user has reached the top of the list and when the user presses the "up" key, I can set a different UI element into focus?
0 Kudos
9 Replies
speechles
Level 7

Re: ZoomRowList never loses focus?

You need set an observer to watch a field for the change of the focus you want: rowFocused, rowItemFocused, currFocusRow.

The observer calls a function/subroutine so you can react to the focus changes. It will pass in the field you requested it observe as an argument.

The ZoomRowList never loses focus because once you are at the top and press up again the OnKeyEvent will pass-through to the next node up. It filters up.

So where you call the ZoomRowList(in whatever calls this component) is where you could use the OnKeyEvent against if ZoomRowList has focus and they press up. If they are in the ZoomRowList and press up and are at the top the ZoomRowList OnKeyEvent doesn't care. It will pass this up. So you must catch this in the OnKeyEvent from where ZoomRowList is called. How you understand. You basically are stuck in the ZoomRowList until an observer reacts that brings focus somewhere else. This is how all scene graph works.
0 Kudos
jaxim
Level 7

Re: ZoomRowList never loses focus?

Right! That is how I understand how it SHOULD work. But it doesn't seem to be the case.
 
I am saying that ZoomRowList doesn't seem to relinquish its OnKeyEvent() pass-through so the component that contains the zoomRowList never has its OnKeyEvent() get triggered.
 
Have you implemented ZoomRowList? Have you been able to listen to the OnKeyEvent() pass-through?
0 Kudos
speechles
Level 7

Re: ZoomRowList never loses focus?

Even if it doesnt pass through the onKeyEvent you can get the focus it has by reading the observer. No I've never use ZoomRowList just normal RowList and it works.. well.. like normal. To escape the ZoomRowList you may have to make a selection or the user has to use back key. That may seriously be the only way. That is how some of these work. I know labellist and checklist let presses pass-through once you get to the outtermost/innermost (top/bottom left/right) selections. These behave differently.
0 Kudos
jaxim
Level 7

Re: ZoomRowList never loses focus?

This is not an option. I can observe that a row gets focus, but I cannot observe that the UP arrow was pressed.

This should work like RowList, but because ZoomRowList is new, I suspect it has a lot of bugs and is probably not ready for primetime.

You mentioned not having personal experience with ZoomRowList so I wonder if others who have had personal experience with ZoomRowList will confirm that this component is bug ridden or if there is another way I need to go about doing things. [/font]
0 Kudos
destruk
Level 10

Re: ZoomRowList never loses focus?

What you could probably do is add a component to your zoomrowlist display, and set the added object to have focus, that way you can capture events using the added object and pass them through to the zoomrowlist.  It's more complicated, but it should take care of the issue?  Since zoomrowlist had focus by default though, you should be using an observver to determine what item in which row has highlighhtfocus to update the decoration instead of hacking in workarounds like this?

ie
<group id="mygroup">
<zoomrowlist><zoomrowlist>
<poster></poster>
</group>
m.mygroup=findnode("mygroup")
m.mygroup.getchild(1).setfocus(true)
0 Kudos
destruk
Level 10

Re: ZoomRowList never loses focus?

When you are in the topmost category, I think pressing UP on the remote with a set of zoomed rowlists or basic rowlists ought to pass through - if it doesn't then that is a bug.
0 Kudos
jaxim
Level 7

Re: ZoomRowList never loses focus?

@destruk It should be passing thru, but it's not. So I agree; I think it's a bug.
0 Kudos
destruk
Level 10

Re: ZoomRowList never loses focus?

If wrap is set to false then up on the first row and down onn the bottom row should allow the events to pass through, but that doesn't, so that is a bug.
0 Kudos
norcaljohnny
Level 7

Re: ZoomRowList never loses focus?

Cant you use something like this on your keypress function...

if (m.rowlistID.setFocus(true) AND m.rowlistID.rowFocused=0)
m.otherlistID.setFocus(true)
return true
end if
0 Kudos