From 8eb45556fd381e5bf02a4773c8cd758204971a5e Mon Sep 17 00:00:00 2001 From: Ryan Law Date: Tue, 18 Jul 2023 11:21:02 +0100 Subject: [PATCH] FIX: timeout and RT calculation in wait_for_button_press --- scansync/meg.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scansync/meg.py b/scansync/meg.py index bf04ec7..421fffa 100644 --- a/scansync/meg.py +++ b/scansync/meg.py @@ -241,12 +241,14 @@ def wait_for_button_press(self, allowed=None, timeout=None): # Check whether a timeout occurred. if timeout is not None: - timed_out = t1 - t0 < timeout + timed_out = t1 - t0 > timeout # Stop the task. task.stop() - - return button, t1 + + RT = t1 - t0 + + return button, RT def _wait_for_button_up(self, buttons=None):