Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
fix,feat: added clear buttons to stop premature actions from user
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellJC committed Oct 5, 2024
1 parent c717dca commit c8a10c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/drivers/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,20 @@ def wait_for_button_press(self) -> int:
Returns:
The number of the button pressed.
"""
self._clear_buttons()
while True:
if self.button0.was_pressed:
return LEFT_BUTTON

if self.button1.was_pressed:
return RIGHT_BUTTON

def _clear_buttons(self) -> None:
self.button0.was_pressed
self.button1.was_pressed
self.button0.was_double_pressed
self.button1.was_double_pressed


## SECTION: Picture

Expand Down

0 comments on commit c8a10c0

Please sign in to comment.