Recording response after current trial loop end

Hi, I’m currently running a RSVP-like task (Rapid Serial Visual Presentation), where images are presented in a rapid serial stream (fixed time) for entire block and participant need to press key when the target present. However, I need to code every 4 images into one trial for some condition needs and the target might appear at the end of the trial (so participant might not be able to respond before trial end). I hope to keep recording the response for current trial even it moves to the next trial. Is there any way to do it?