Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 7

Roinput events & wait(x,port) beta 3.0

I'm encountering an issue where an roinput event is received at a port in a function and an old roinput event is waiting at the port in main() when the function returns. This appears to be the event left over from the event that launched the channel in the first place. Any way to "drain" the port so it doesn't contain an old event? Not sure if this is a bug or not, but it is causing me some trouble...

-Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
1 Reply
Highlighted
Level 15

Re: Roinput events & wait(x,port) beta 3.0

I don't know if this thread is similar to what you're seeing or not, but I used this code to eat the unexpected Back button that was waiting in the queue:
    ' eat possible Back button
msg = wait(100,port)
if type(msg) = "roImageCanvasEvent" then
if msg.isRemoteKeyPressed() then
print "Key Pressed - " ; msg.GetIndex()
end if
end if

Perhaps you could do something similar. Some sort of flush for the event queue might not be a bad addition to the SDK.

-JT
0 Kudos