Quote:
I would not set the event in a while loop btw.

This is true since the event function is called every time the EVENT_PUSH occurs so you don't need the while loop.

Quote:
and emask needs |= not =

This is only partially correct. "|=" adds the event to the existing list of events and "=" sets the event list to (only) EVENT_PUSH.