Pausing the experiment with a joypad instead of the escape key?
Hi, I would like to pause the experiment with the start button of a joypad instead of the escape key. Is there a way to do that?
Thanks in advance!
Hi, I would like to pause the experiment with the start button of a joypad instead of the escape key. Is there a way to do that?
Thanks in advance!
Comments
Hi,
If you're using inline_scripts, you could use the exp.pause() function. Basically, you have to check at relevant points during the experiment (e.g. at the end of the trial sequence) whether your desired button was pressed, (see http://osdoc.cogsci.nl/devices/joystick/#function-basejoystickflush for relevant functions), and pause the experiment accordingly using an if-statement.
The escape key will still work to pause the experiment as well, but I reckon this is not a problem?
Cheers,
Josh
Thank you Josh! I was able to pause the experiment thanks to your solution. However I can't seem to exit the pause screen now. Both the Q and spacebar keys are unresponsive. The thing is I'm not using the joypad plugin because it won't accept d-pad inputs so I'm using an inline script with a while loop that "listens" for either button or d-pad inputs instead. I wonder if this while loop could be the culprit? Maybe the loop is still running when in pause mode... Anyway, is there an exp function to exit the pause screen so I can trigger it with the joypad? That could be a quick and dirty fix... Thanks again!