How to make sure that two keys are pressed simultaneously before beginning each trial
Hello,
I have a stroop like experiment that I would like to do, where I measure the reaction time.
A trial would go like this. I have a response box in front of the participants. It has four buttons. Two next to each other in the middle and one at the top and one at the bottom. At the beginning of each trial the participant has the two middle keys pressed and when they are shown the stimulus they have to decide if they need to press the top or buttom key. Then they release either the top or bottom key and press the respective one. After they press the key, the screen turns white until the next trial starts with a fixation point.
I can't seem to successfully put in a press event before the trial because it doesn't register if you have already pressed the buttons during the blank screen.
So my questions is whether there is a function that detects if or which keys are currently being pressed or if there is a different way to achieve that function.
I would be glad for some ideas/help. Thank you.
Comments
Hi Tori,
whether there is a function that detects if or which keys are currently being pressed
Nope, there is no such function. You could use two response items after each other, the first one has as allowed_responses both buttons, the second one, only the one that was not pressed in the first one. Maybe you have to wrap a loop around it, so that you can make sure that the two button presses happen in rapid succession (i.e. virtually simultaneously), and if not, restart the first response item again.
Not sure this will work, but it's worth a try. In any case you will be able to use Python scripting to poll for two responses for sure.
I can't seem to successfully put in a press event before the trial because it doesn't register if you have already pressed the buttons during the blank screen.
I don't get this. If you need help with it, maybe share your experiment with us.
Eduard
@eduard I have my experiment attached. I cannot figure out use the correct Python script for the two responses. The experiment is in German, I hope it is still understandable.
Hi Tori,
Your experiment is a bit long and not so easy to follow. I attach an experiment of my own in which I demonstrate how you can simulate parallel key presses. You could try to include this loop into your experiment whenever you need your participants to have both keys pressed. I am not sure it works in more complex scenarios seamlessly (especially with many nested loops), and I haven't checked the timings in detail, but I think it comes pretty close to what you need.
Hope this helps!
Eduard
ps. for future reference, try to distill away as much as possible from your experiment without removing the part you have a question about, so that we have an easier time, finding and fixing the problem ;)