my current experiment requires the use of the left and right mouse button as response keys, because the participants need to respond in different postures (sitting, standing, and lying down). The mouse can be put in their hands more easily than the keyboard.
Basically, all I need to do for that is to record the press of the left and right mouse button the same way I’d record e.g. pressing “V” and “M” as response keys - to record their timing and accuracy (correct / false response). Pretty standard stuff, one would think.
However, as far as I know, there is no option of waiting for mouse clicks in PsychoPy?
- event.waitKeys() allows to wait for keypresses on the keyboard, but not on the mouse
- mouse.getPressed() allows to register whether a mouse key is currently being pressed, but does not make the core wait for the press
- using core.wait() and hogCPU for the entire time of the wait allows for registering mouse button presses during the wait, but will not interrupt the wait once the click occurs; if for example you set the waiting duration to 5 seconds, you will have to wait for the entire 5 seconds to pass even after having clicked
- I read about a function of the core.Clock() called clock.getSecs() - someone was using “while clock.getSecs() < 3”, followed by event.getKeys() and mouse.getPressed(), but PsychoPy tells me “Clock” had no attribute called “getSecs”
At my institute the preceding study using this paradigm was conducted using Experiment Builder, which is also in Python, but this also means no one there has a template for waiting for mouse clicks in PsychoPy based on previous research.