Skip to content
Snippets Groups Projects
Commit a924fdad authored by Pixtxa's avatar Pixtxa
Browse files

Style angepasst

parent 9ec09ea2
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ except OSError:
""":py:func:`~simple_menu.button_events` timeout marker."""
def button_events(timeout=None, long_press_ms = LONG_PRESS_MS, retrigger_ms = RETRIGGER_MS):
def button_events(timeout=None, long_press_ms=LONG_PRESS_MS, retrigger_ms=RETRIGGER_MS):
"""
Iterate over button presses (event-loop).
......@@ -89,13 +89,16 @@ def button_events(timeout=None, long_press_ms = LONG_PRESS_MS, retrigger_ms = RE
if v & buttons.TOP_RIGHT:
yield buttons.TOP_RIGHT
if not still_pressed and long_press_ms and time.time_ms() - t0 <= long_press_ms:
if (
not still_pressed
and long_press_ms
and time.time_ms() - t0 <= long_press_ms:
):
pass
else:
if retrigger_ms and time.time_ms() - t0 > retrigger_ms:
button_pressed = False
still_pressed = True
class _ExitMenuException(Exception):
......@@ -332,7 +335,7 @@ class Menu:
self.disp.update()
def run(self, long_press_ms = LONG_PRESS_MS, retrigger_ms = RETRIGGER_MS):
def run(self, long_press_ms=LONG_PRESS_MS, retrigger_ms=RETRIGGER_MS):
"""Start the event-loop."""
try:
timeout = self.scroll_speed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment