Sentence to appear after key press

I am building my first experiment in PsychoPy and I’m having trouble with timing. What I want the experiment to do is this: start with a fixation cross that disappears with a key press, after the participant presses the key, a sentence appears and they press a key after reading the sentence to make the sentence disappear. I cannot figure out how to set the start for the sentence to make it appear after the fixation cross disappears. I’ve tried setting the start to a condition and then used $fix.status==FINISHED, when I do that, the sentence never appears, only the fixation cross. I also tried $fix_resp.status==FINISHED with the same results. How should I write the condition to make the sentence appear after the participant presses a key? Thanks!

Why don’t split the process into routines? You could check “Force end of Routine” for the key component in the first two routines, then the experiment progresses to the next Routine when a key is pressed. The first routine would have only fix and fix_resp and the second routine would have sent and key_resp_2.

I’m sure, you could do everything in one routine, but that would make it more complex.

Lukas is correct that the easiest way to achieve what you want is to split the trial across two routines.

Your initial idea of using a conditional expression is indeed also a valid approach. The reason it isn’t working here is that the fixation stimulus never finishes, so fix.status==FINISHED never becomes True. The reason for that is that fix_resp.status==FINISHED is not the right thing to check. Instead you would want something like len(fix_resp.keys) >= 1. i.e. check that at least one key has been pressed. The keyboard component doesn’t finish on a key press unless you tell it to, and that will also end the entire routine, so can’t be used to trigger other changes in that routine.

So to summarise, your initial approach could indeed be made to work, but it is much simpler to use Lukas’ suggestion to split the trial across routines, which avoids the use of any code at all.

Good luck with your experiment, you’ve made good progress so far with understanding how things should work.

1 Like

Thank you, both! Splitting it into two routines is the solution. I was thinking about routines wrong!