I have set up a perceptual decision task, where a sequence of stimuli/samples flashes on the screen (presentation rate between two consecutive stimuli is approx. 200ms) and the participant needs to make a keypress at any point during the sequence, to indicate whether more samples appear on the left or right side of the screen. The presentation of a single sample occurs within a routine (pictured below), which is ran by a loop that terminates once a keyboard response has been made.
Now, this all works as it should - except that, on some trials (1/10 or so) the first key press does not register at all and the key has to be pressed again. Of course, this inflates the actual response times and contaminates my data, which is why I would like to solve this issue. I suspect that this happens whenever the key is pressed ‘between loops’ - after Sample X has ended, but before Sample X+1 started. If my intuition is correct, then this issue could by solved by removing the stimulus-presenting loop, and instead include the sequence of stimuli in one routine. This, however, would be cumbersome and probably cause further complications, since I would be unable to select stimuli from the conditions file, the way I do now using a loop.
My question is, has anyone encountered a similar issue and would be able to advice me on what to do? Is there perhaps a way to move the keyboard component ‘a level up’ so that it is not tied to the ‘samples’ loop, but instead starts at the beginning of the ‘trial’ loop and operates in parallel with the samples-presenting routine?
Many thanks in advance for any tips!