[solved] I would like a pause button
Hello everyone !
I'm beginner with opensesame.
I'm currently running and experiment using EEG. I would like to setup a button or something, which would allow me to make a pause at any moment.
Sometimes, an electrodes detach itself and I would like to be able to pause my OpenSesame script to repair the electrode.
Any idea ?
I searched in the documentation but I didn't find anything about a pause.
Johan.

Comments
Hi Johan,
OpenSesame doesn't have a pause button, but you could implement one quite easily. The most convenient way to do this depends on your experiment, but the following is one option.
keyboard_responseto the start of your trial_sequence. Disable 'Flush pending keypresses', set the timeout to 0, and set the allowed responses to p.sketchpadjust after thekeyboard_response. Add a text message like, 'The experiment is paused'. Set the run if statement for thissketchpadto[response] = p.Do you see the logic here? Basically, if you press 'p' somewhere just before a new trial starts, this will cause the pause
sketchpadto be shown.Hopefully this will get you started!
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Okay Sebastiaan,
I think I see how it could work. I will test it when I have some time and come back here to make a feedback.
Cheers,
Johan
Hello,
So I tried a lot of thing running with this idea but i must be doing something wrong. i never had the good result.
Most of the time, either I obtain a black screen (at the beginning of my sequence, when I put the two element here) and the experiment continues only if I press p, or I have a problem with the variable name. [response] does not exist in the sketchpad element...
I tried with the two item at the beginning at the sequence, at the end, nothing changes.Perhaps you will have other idea or correction.
or
Hi Johan,
I cannot really tell from your example what goes wrong, but the instructions in my previous post should work. Except for this, which I hadn't considered:
I forgot that the variable
responsedoes not exist at the beginning of the experiment, so the run-if statement[response] = pwill cause an error. To fix this, you can simply add the following line to the top of your experiment's general script:This will give
responsean initial value.To get you started, here's a working example of a pause button:
Good luck!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Yeah,
I just tried your advice and it's working. The problem was due to the value of the [response] variable.
Thanks !
Okay it worked 3 times and now it fails every time.
I will work on it and come back if nothing work.
Bye,
Johan
Hello,
I really think the idea is good but it fail to work with my script.
Johan