Forum Discussion

TheEndless's avatar
TheEndless
Channel Surfer
15 years ago

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?

7 Replies

  • 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.
  • "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?
  • "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.
  • renojim's avatar
    renojim
    Community Streaming Expert
    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
  • "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...
  • 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