diff options
| -rw-r--r-- | wasp/apps/stopwatch.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/wasp/apps/stopwatch.py b/wasp/apps/stopwatch.py index ac29999..c2f756b 100644 --- a/wasp/apps/stopwatch.py +++ b/wasp/apps/stopwatch.py @@ -21,7 +21,8 @@ class StopwatchApp(): self._draw() wasp.system.request_tick(97) wasp.system.request_event(wasp.EventMask.TOUCH | - wasp.EventMask.BUTTON) + wasp.EventMask.BUTTON | + wasp.EventMask.NEXT) def sleep(self): return True @@ -29,6 +30,16 @@ class StopwatchApp(): def wake(self): self._update() + def swipe(self, event): + """Handle NEXT events by augmenting the default processing by resetting + the count if we are not currently timing something. + + No other swipe event is possible for this application. + """ + if not self._started_at: + self._reset() + return True # Request system default handling + def press(self, button, state): if not state: return |
