Each event of the experiment in question asks the participant to view a two-second (thin slice) facial expression video clip. After viewing, they recieve a screen that asks whether they think the model they just viewed is experiencing pain, to which they may respond y or n (key press). Next, they respond to a subjective metric asking 6 Likert scale questions in turn - valid (and correct) responses are keys 1-5.
The experiment runs smoothly, and all data is tracked, including whether the participant has provided a correct or incorrect response (i.e. y would be incorrect if the model was not displaying a pain expression) with a C or E in the Error Code column. The data also notes as incorrect (E) any invalid or undefined keypresses.
What I would like the experiment to do, if possible, is to not move past a screen to which the participant should respond until a valid key is pressed (whether correct or incorrect). On the pain question, the only valid responses would be y or n (not 1-5, or any other keys), although either y or n could be correct depending on the stimulus. When responding to the Likert scale, 1-5 are correct and valid, but y, n, and any keys outside of 1-5 are invalid.
Is it possible to make the question screen stay as it is if an invalid key is pressed, to passively prompt the participant to press a valid key (and assist this researcher in collecting as much valid data as possible!), only after which the screen will change to the next prompt/stimulus?