Using specific keys to go back, repeat or end a trial

Hiya forum :slight_smile:
I’m creating an experiment to find participants threshold of perception with some masked images.
I need to give them the option to use arrow keys to go back to a previous trial (Back Arrow), repeat a current trial (Up Arrow) or continue to the next trial (Right Arrow).
Using the Right Arrow to force and end to the current task is easy, but I don’t know how to write code for repeating or going back. My efforts as copying other people’s code and changing the names of components failed.

My trial names are:
trial_Hz5
trial_Hz4
trial_Hz3
etc…

My Loop names are:
rep_Hz5
rep_Hz4
rep_Hz3
etc…

Like so:

The loops are connected to the trials of the same name, and are ordered by the end number.
How would I code for the UP arrow to repeat the current trial, and the LEFT arrow to go back to the previous one?

Happy to include more info if I’ve left out important details. Your help is much appreciated!
Peter