thanks for this forum and the helpful answers here.
I read the discussion above after I have encountered a similar problem and I think that the solution suggested here can also help me. I tried your code component in order to present stimulation depending on keyboard response. The problem is that I don’t use a movie- my stimulation is shapes/polygons that should appear after each keyboard press. Without the movie file, the “Each frame” tab is useless and the value of "number_pressed " stays “true” after the first key press.
Is there a way to change the code to re-initialize the variable "number_pressed " after each press?
*Attached is the script of my task
test_seq23142.py (25.3 KB)