I need to display a set of instructions to the user that, upon reading, they press space to continue onto the experiment. I tried using Keyboard.waitKeys()
, but it wasn’t behaving the way I expected it to so I’m trying other things. Currently, my solution looks like this:
stimuli_key_resp = keyboard.Keyboard()
keys = stimuli_key_resp.getKeys(['t', 'escape', 'space'], waitRelease = False)
while continueRoutine:
t = trialClock.getTime()
tThisFlip = win.getFutureFlipTime(clock=trialClock)
tThisFlipGlobal = win.getFutureFlipTime(clock=None)
frameN = frameN + 1
if (instructions.status == NOT_STARTED and tThisFlip >= 0.0 - frame_tolerance):
instructions.frameNStart = frameN
instructions.tStart = t
instructions.tStartRefresh = tThisFlipGlobal
win.timeOnFlip(instructions, "tStartRefresh")
instructions.setAutoDraw(True)
if instructions.status == STARTED and 'space' in keys:
instructions.tStop = t
instructions.frameNStop = frameN
win.timeOnFlip(instructions, "tStopRefresh")
instructions.setAutoDraw(False)
But doing this, the program never responds to a space being pressed and the only way to get out of the instruction screen is to close the experiment. Can someone give me suggestions on how to accomplish this?