URL of experiment: https://pavlovia.org/run/Naama/projectfile_boys/html/
Description of the problem: Hi, can anyone help me to convert a Python code to JS please?
In my experiment I want to end a routine (not the entire loop!) if the participants press ‘left’ or ‘right’, but to continue the routine if they press ‘space’.
In the builder, I used this Python code:
from psychopy import event keys = event.getKeys() if keys: if 'space' in keys: # skip routine continueRoutine = True #do not end routine. elif 'right' in keys or 'left' in keys: continueRoutine = False #end routine.
I tried to convert this code to JS, but it still doesn’t work
That is, in the moment, it doesn’t matter if they press ‘left’, ‘right’, or ‘space’, it continues the routine.