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: 
TheEndless
Channel Surfer

New BACK button produces undesirable roImageCanvas behavior

I was playing around with the telnet commands for the new Roku remote buttons, and found that the new BACK button produces some unfortunate results in my existing apps. From what I can tell, it's primary function is to close the current screen in the stack. While that's helpful in some cases, it doesn't appear to actually send a IsRemoteKeyPressed event, so it can't be overridden or prevented. The end result is potentially very undesirable in channels with custom drawn roImageCanvas screens... particularly those that employ the "optimization" techniques discussed in other threads in this forum, as it closes the top most image canvas without warning. I suppose we could capture the IsScreenClosed event and redraw, but I suspect that would cause unwanted screen flicker.

Any chance this behavior is overridable in the upcoming 2.7 SDK?
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
7 REPLIES 7
kbenson
Visitor

Re: New BACK button produces undesirable roImageCanvas behav

That's... unfortunate. Such is life on the bleeding edge of hackery though.

I fully expected future changes might completely screw up what we were doing. Within a few releases I figure roImageCanvas will have stabilized enough in capabilities and it's API that we can be more secure it it's behavior. As a still fairly new capability, it's bound to have some changes in store until then.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
TheEndless
Channel Surfer

Re: New BACK button produces undesirable roImageCanvas behav

"kbenson" wrote:
That's... unfortunate. Such is life on the bleeding edge of hackery though.

I fully expected future changes might completely screw up what we were doing. Within a few releases I figure roImageCanvas will have stabilized enough in capabilities and it's API that we can be more secure it it's behavior. As a still fairly new capability, it's bound to have some changes in store until then.

Only problem is, we can't address it in our contest apps for another 2 weeks... 😛
KidPaint actually seems to handle it pretty well, though. Are you responding to the IsScreenClosed() event on your cursor canvas, because it redraws as soon as I hit back?
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
kbenson
Visitor

Re: New BACK button produces undesirable roImageCanvas behav

"TheEndless" wrote:

Only problem is, we can't address it in our contest apps for another 2 weeks... 😛


Yeah, that sucks. Probably won't be many people with that capability before then though.


KidPaint actually seems to handle it pretty well, though. Are you responding to the IsScreenClosed() event on your cursor canvas, because it redraws as soon as I hit back?


Yeah, but not in a way that I would think would result in good behavior:

if type(msg) = "roImageCanvasEvent"
if msg.isRemoteKeyPressed()
m.HandleKeyPress(msg)
UIUpdateUI(m)
else if msg.isScreenClosed()
return
end if
end if


That's an object method called directly from Sub Main. The return would cause it fall right out the end of Main, thus ending the application. Not sure how you are getting good behavior out of that, unless it's not calling msg.isScreenClosed()? I have to admit I haven't played with this at all yet, and am unsure exactly what you are seeing event wise when you hit back.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
renojim
Community Streaming Expert

Re: New BACK button produces undesirable roImageCanvas behav

I'll repeat this here because I don't think I can possibly overstate it: I think it would have been MUCH better if the Back button was treated like any other button and just produced an isRemoteKeyPressed() event.

-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
TheEndless
Channel Surfer

Re: New BACK button produces undesirable roImageCanvas behav

"kbenson" wrote:
That's an object method called directly from Sub Main. The return would cause it fall right out the end of Main, thus ending the application. Not sure how you are getting good behavior out of that, unless it's not calling msg.isScreenClosed()? I have to admit I haven't played with this at all yet, and am unsure exactly what you are seeing event wise when you hit back.

Yeah, that definitely doesn't sound like it would be the expected behavior... strange... The only event I'm seeing is an IsScreenClosed() event, but I haven't dug into it too much, I just basically tested my apps with it to see how they would behave, and did some limited testing with prints in my event loop, but nothing too in depth...
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
RokuKevin
Visitor

Re: New BACK button produces undesirable roImageCanvas behav

This was an oversight on our part. We should have made the back button produce an isRemoteKeyPressed() event rather than an isScreenClosed() event on the roImageCanvas.

We will change these semantics so that it generates an isRemoteKeyPressed() event in an upcoming release. We are aware that we broke some apps with this change and we apologize for that. The fix should be coming soon....

--Kevin
0 Kudos
renojim
Community Streaming Expert

Re: New BACK button produces undesirable roImageCanvas behav

Thank you!

-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