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
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