astro-pi / python-sense-hat

Source code for Sense HAT Python library
https://sense-hat.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
508 stars 255 forks source link

Added method to clear all outstanding events. #69

Open Samathy opened 7 years ago

Samathy commented 7 years ago

Clearing the outstanding events is useful if you need to get rid of a button release event in preparation for receiving the next button press event. Since the release event happens after the previous call to wait_for_event() or get_events() it isnt cleared and will appear in the next call to wait_for_event() or get_events().