event.waitKeys() causing freezing issues

Hi @sol thanks for your reply. I’ve tried to implement the changes you suggested, but I’ve run into some trouble. I now get the following error when trying to launch ioHub:

 *** iohub warning: Display / Monitor unit type has not been set.
Traceback (most recent call last):
  File "rsvp_sweep.py", line 625, in <module>
    io = launchHubServer()
  File "/Users/jeff/.conda/envs/ioWait_test_env/lib/python3.6/site-packages/psychopy/contrib/lazy_import.py", line 120, in __call__
    return obj(*args, **kwargs)
  File "/Users/jeff/.conda/envs/ioWait_test_env/lib/python3.6/site-packages/psychopy/iohub/client/connect.py", line 290, in launchHubServer
    return ioHubConnection(iohub_config)
  File "/Users/jeff/.conda/envs/ioWait_test_env/lib/python3.6/site-packages/psychopy/iohub/client/__init__.py", line 289, in __init__
    raise RuntimeError('Error starting ioHub server: {}'.format(self.iohub_status))
RuntimeError: Error starting ioHub server: ioHub startup failed.
ioHub Server Process Completed With Code:  Negsignal.SIGSEGV

I’ve tried downgrading pyglet to 1.3.1 (as you suggest here), but I get some error messages when trying to setup the environment. It looks like pyglet 1.3.1 isn’t available for Mac, and isn’t compatible with my psychopy version (which isn’t as important). Do you know which version of psychopy I can download to make io = launchHubServer() work properly? Also, I use Anaconda to manage the environment, if that helps at all.

 pip install pyglet==1.3.1
Collecting pyglet==1.3.1
  Using cached pyglet-1.3.1-py2.py3-none-any.whl (1.0 MB)
Requirement already satisfied: future in /Users/jeff/.conda/envs/ioWait_test_env/lib/python3.6/site-packages (from pyglet==1.3.1) (0.18.2)
Installing collected packages: pyglet
  Attempting uninstall: pyglet
    Found existing installation: pyglet 1.5.16
    Uninstalling pyglet-1.5.16:
      Successfully uninstalled pyglet-1.5.16
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
psychopy 2021.2.3 requires jedi>=0.16, which is not installed.
psychopy 2021.2.3 requires psychtoolbox, which is not installed.
psychopy 2021.2.3 requires pygame, which is not installed.
psychopy 2021.2.3 requires pyo, which is not installed.
psychopy 2021.2.3 requires pyobjc; platform_system == "Darwin", which is not installed.
psychopy 2021.2.3 requires python-vlc>=3.0.12118; platform_system != "Windows", which is not installed.
psychopy 2021.2.3 requires tobii-research; python_version <= "3.6", which is not installed.
psychopy 2021.2.3 requires ujson, which is not installed.
psychopy 2021.2.3 requires pyglet>=1.5; platform_system == "Darwin", but you have pyglet 1.3.1 which is incompatible.
Successfully installed pyglet-1.3.1