Hi, I am a newbie for not only PsychoPy, but overall programming.
I built an experiment for the self paced reading changing the stimulus by pressing the space bar (by the request from my professor).
The experiment runs well at both the PsychoPy running and Pavloiva pilot running.
However, I got a big problem about the case if people enters a key which is not a space bar.
If you press a key other than the space bar, the experiment lose the response, so there is no other way but to forcibly shut it down.
I added the code that makes the loop continue if the key gotten is not space bar nor escape, but the problem doesn’t solve.
Hello BJ_Kim.
I just finished my own Self-Paced Reading Task and your keyboard component is fine. Of course, you can’t force end routine as you need the rest of the words in the sentence to appear in the same repeat. I can assure you my keyboard component looks the same, so it must be something else. Maybe the problem is within the code component - the function where you “catch” the keyboard response. Do you use event.getKeys('space') ?
Hi BJ_Kim! I had the same problem and just solved it in another way. I moved the “i = i + 1” line out of the “else if” loop and place this line to the end of the “while” loop. In that way, the value of i will be updated even if the key pressed is not space. Here is a screen shot of the codes that I used.