event polling: return 0 if no event, 1 if event