From 6ee44d00c208c10858ec6ecced38a23171ec170e Mon Sep 17 00:00:00 2001 From: W4ltz <40773550+PeterWaIIace@users.noreply.github.com> Date: Sun, 11 Aug 2024 23:53:47 +0200 Subject: [PATCH] Update README.md with check against None --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 88e6986..e82d816 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,11 @@ while true: screen_width, screen_height, context="my_context") - - cursor_x, cursor_y = event.point[0], event.point[1] - fixation = event.fixation - # calibration_radius: radius for data collection during calibration + + if event: + cursor_x, cursor_y = event.point[0], event.point[1] + fixation = event.fixation + # calibration_radius: radius for data collection during calibration ``` @@ -132,9 +133,11 @@ event, cevent = gestures.estimate( screen_height, 0, 0, 0.8, 10 ) -cursor_x, cursor_y = event.point[0], event.point[1] -fixation = event.fixation -# cevent - is calibration event + +if event: + cursor_x, cursor_y = event.point[0], event.point[1] + fixation = event.fixation + # calibration_radius: radius for data collection during calibration ``` Feel free to copy and paste the relevant code snippets for your project.