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

roGridScreen msg.isListItemFocused bug?

I've noticed another issue. Sometimes (quite often actually) the roGridScreenEvent message is returning incorrect values for the selected row/column. When checking msg.isListItemFocused, the msg.GetData() (column) value is "8801162" and/or the msg.GetIndex() (row) value "65536". I'm not entirely sure how/when it's happening -- but it's happening before the isListItemSelected event. Sometimes the row value is right and the column value is wrong -- sometimes they're both off. Attempting to use these values in conjunction with a backing store is problematic. For now, I'm putting in sanity checks. Has anyone else experienced this issue yet?
0 Kudos
4 REPLIES 4
RokuChris
Roku Employee
Roku Employee

Re: roGridScreen msg.isListItemFocused bug?

I saw something like this a while back, but it turned out to be an issue with my code and not the grid screen. I can't remember what the problem was off the top of my head. If I come across the answer, I will post it here.
0 Kudos
retrotom
Visitor

Re: roGridScreen msg.isListItemFocused bug?

"RokuChris" wrote:
I saw something like this a while back, but it turned out to be an issue with my code and not the grid screen. I can't remember what the problem was off the top of my head. If I come across the answer, I will post it here.


I think I figured it out. The focused event is getting fired every time I select something. So it's like it fires focus and then select events when I press the button. The row/column values are wrong for the focus event and right for the selection event. Not sure what to do about that...other than to check for selection before focusing.

I have (pseudo-code):
if focused then
...
else if selected then
...
end if

when it might work better if I have this:
if selected then
...
else if focused then
...
end if
0 Kudos
retrotom
Visitor

Re: roGridScreen msg.isListItemFocused bug?

That doesn't work. I'm seeing two distinct events. Not sure what to do about it other than my sanity check.
0 Kudos
renojim
Community Streaming Expert

Re: roGridScreen msg.isListItemFocused bug?

I ran into the same thing when I was iterating over all the rows and setting the focused item to the first one. I'd occasionally get a focused event with a row index of one more than should have been possible and a column that made no sense whatsoever - probably 8801162. I just added the sanity check and forgot about it.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.