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: 
renojim
Community Streaming Expert

Hierarchy of Poster screens

I'm trying to implement a hierarchy of Poster screens similar to the blip.tv channel. The problem I'm having is that as far as I can tell, pressing the Up button or the Home button on the remote both generate an isScreenClosed event with no way to discern which button was pressed. If I navigate down into my hierarchy and then press the Home button, the Roku wants to jump to the home screen, but I can't tell the difference between that and the user pressing the Up button. Is there someplace that the hierarchy gets spelled out that I'm missing?

Thanks,
-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
4 REPLIES 4
EngoTom
Visitor

Re: Hierarchy of Poster screens

Have you tried msg.isRemoteKeyPressed()

Here is some code from my springboard for left and right but not up or home. Worth checkng out thoough...

else if msg.isRemoteKeyPressed()
if msg.GetIndex() = remoteLeft then
'do something
endif
if msg.GetIndex() = remoteRight then
'do something
endif
else
0 Kudos
renojim
Community Streaming Expert

Re: Hierarchy of Poster screens

Thanks for the suggestion, but it appears that isn't implemented for Poster screens. I put
msg = wait(0, screen.GetMessagePort())
if msg.isRemoteKeyPressed() then stop
in my event handler for the Poster screen and it never hits the stop. I have to be missing something simple. I'm going to try to modify the 'simpleposter' example to add another layer to the hierarchy to see if there's something wrong with my code, but I'm not hopeful. Anyone have the source code for the blip.tv channel? 😄

-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
TommyTheKid
Visitor

Re: Hierarchy of Poster screens

I am fairly sure that, no matter where you are in your application, the "HOME" button on the remote will exit your channel. This is by design. I don't think you can use the "home" button (for example to go back to the home screen of your channel). However, up should work. UP generally "exits" the last screen, so just create a new roPosterScreen object each time they select something, then when they press up (close) that screen, it will be back on the previous one. (just an idea?)

Tommy
0 Kudos
renojim
Community Streaming Expert

Re: Hierarchy of Poster screens

Tommy,

You got it. I should have returned here earlier, I could have saved a few hours. It only took all day for it to dawn on me. You have to create new screens as you navigate down your hierarchy and keep track of them in an array or whatever. When the Up button is pushed, you'll get the isScreenClosed as the current screen is closed. Pop that one off your stack and call the .Show() function for the previous one in the stack. The Home button will produce isScreenClosed messages for all of the screens in your stack. When you get the isScreenClosed message for the top level screen you can exit gracefully.

I might suggest to Roku that the simpleposter example be made slightly more complex to illustrate this. Maybe I'm just getting stupid in my old age, but this literally took me a day to figure out.

Thanks for everyone's responses.

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