It might be better to return Result rather than Option for wait_for_packet. I don't see a normal good case where it is okay to return None when we expect an event to be returned from that function.
This applies at least to:
- wait_for_packet
- wait_for_key_event
- wait_for_input_event
Please investigate the usefullness before starting to implement.