There is no response after pressing the button

I want to present a set of pictures in each trial, and produce different results according to the different keys. Press the left button to display “left” and right-click to display “right”. The number of repetitions is five times, and the pictures presented by each tria are not exactly the same. But when my program was running, after the first set of pictures appeared and pressed the button, there was no response, but ended the operation directly. Can someone help me see which step is wrong?