psychopy.org | Reference | Downloads | Github

(Solved) Is it possible to use button (like arrow) to navigate thru the trials back and forth

Hi, Just the question in the title, is there any way to realize this function with two arrow keys? This function is purely used for instruction displaying text. There is no interaction part.
Assuming multiple pages of instruction and each at one trial.

If you pre loaded the instructions into a list as per my independent randomisation demo then you could display instructions based on arrow key responses in a second loop.

I use more complicated version of this in my interactive fiction experiments.

Thanks for the reply! Would you mind if you can share a link to that demo? Thanks!

My demos are here: PsychoPy Online Demos

You can take a look at Interactive Fiction here.

I haven’t sorted a public access demo for that one yet.

Thanks for sharing!

I have gone thru both demo and I am still not sure I quite get that. In the first demo, the right and left buttons are just recorded as the answer but didn’t trigger any actions executed by the code component. Would you mind if you can clarify a little bit more about how to connect the arrow button to a particular action like go back or go forward?

Thanks in advance!

It doesn’t do what you want but contains the principles.

Once you’ve loaded the instructions into a list the present instructions[thisPage] and add 1 to thisPage for a right arrow and subtract 1 for a left arrow.

1 Like

Solution: Thanks to @wakecarter and also refer to the following post: Here is the core of solving this problem.
The basic idea is to use repetition to mimic the back and forth. Set 1000 reps and each time show a given instruction based on the pressed key.
Attached is a revised version that works to walk the subject thru three instruction back and forth and, when finished, jump to some test.
Instruction walk thru.psyexp (29.6 KB)

1 Like