jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2011
12:20 AM
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
-Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
1 REPLY 1
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2011
02:23 AM
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:
Perhaps you could do something similar. Some sort of flush for the event queue might not be a bad addition to the SDK.
-JT
' 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
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.
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.