I need to collect all keyboard responses while the video is playing and after it’s finished.
So far the code looks like this:
while mov.status != visual.FINISHED:
mov.draw()
win.flip()
continueRoutine = True
response = []
while continueRoutine:
keys = event.waitKeys()
response.append(keys)
if keys[-1] == 'return':
continueRoutine = False
response = response[:-1]
response = [item for sublist in response for item in sublist]
response = "".join(response)
It works, but it collects only the keypresses that occurred after the video stopped playing. Moving the code for key-press collection into the video while-loop expectedly stops the video from playing. Replacing with getKeys()
also breaks the video.
Ideally, I need a solution where I can record RT for the first key press (but I think it should be possible for any solution with clock).