I have a code that has participants type in two letters, they display on the screen, and then the next routine begins (where they have to type in two more letters).
keysT1 = event.getKeys(keyList = ['q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m'])
if len(keysT1) :
if len(textResp1_training.text) == 0 :
textResp1_training.text = textResp1_training.text + keysT1[0]
elif len(textResp1_training.text) == 1 :
textResp1_training.text = textResp1_training.text + keysT1[0]
continueRoutine = False
However, the routine ends as soon as the second key is pressed, so the participant can’t see their second letter before it moves on. So I’m essentially looking for the PsychoPy version of PsychToolbox’s WaitSecs
function. I also want to use a function that’s able to translate to JS easily, if possible (why I’m avoiding clock or core functions). I’ve tried:
#begin routine
endTime = 9999999
#each frame
#everything from first code...
elif len(textResp1_training.text) == 1 :
textResp1_training.text = textResp1_training.text + keysT1[0]
endTime = t + .5
if t > endTime
continueRoutine = False
Which sort of works, but isn’t super reliable. I’m also not sure if t
translates to JS. I’ve also tried inserting a static component (also tried with an invisible polygon) with the code:
#begin routine
startISI = 0
#each frame
#everything from first code...
elif len(textResp1_training.text) == 1 :
textResp1_training.text = textResp1_training.text + keysT1[0]
startISI = 1
if ISI.status == Finished
continueRoutine = False
Then I put $startISI == 1
in the start of the ISI (and polygon) and .5s in the end time. But that’s not working because I’m not sure if .status
works for static or polygon components. Anyone have an idea about how to do this? Thanks!