Forum Discussion

squirreltown's avatar
squirreltown
Roku Guru
12 years ago

2dAPI / inputcontrols

Channel is all 2d custom screens. Have a comment screen to type a comment and email. I am using the channel store "get partial info" to grab the users name and email (share/don't share). The thing is that the remote commands used on the channel store canvas - in this case "up" to select share and "OK" are being executed again once the channel store screen closes and the comment screen opens, changing the focus from where i want it. The channel store and comment screen roUniversalControlEvent are on different ports so i don't see how this is happening. Anything to do about this?

thanks

3 Replies

  • How strange. I imagine you can run a dry loop to flush all events before the main loop of the comments screen? Something like "while port.getMessage() <> invalid: end while". Or even keep flushing for certain amount of time (typed but not tested):
        clock = createObject("roTimespan")
    clock.mark()
    while clock.totalMilliseconds() < 100
    port.getMessage()
    end while


    It sounds like a bug though.
  • Thanks EnTerr, I'll try something like that and see how it goes. I thought crossing wires on separate ports would be impossible.
  • Enterr thanks for the tip, I got rid of the two offending keypresses here, and handled when the store isnt used. Still strange, would like to hear from a RokuEngineer whats up with this
                    clock = createObject("roTimespan")
    clock.mark()
    while clock.totalMilliseconds() < 500
    msg = msgport.getmessage()
    if type(msg) = "roUniversalControlEvent"
    while clock.totalMilliseconds() < 500
    msg = msgport.getmessage()
    if type(msg) = "roUniversalControlEvent"
    exit while
    end if
    end while
    exit while
    end if
    end while