Synchronize parallel port trigger with a mouse click

Hello everyone,

I am using PsychoPy 2022.2.4 on a Windows 10 and I am trying to synchronize the triggers sent via parallel port with a mouse click component.

I would like to have a specific trigger sent when a mouse is clicked and the trial is ended “prematurely”. In my Vocalize Routine, I have a p_port component where I am trying to use the end_trial_mouse_2.status == STARTED command but it is not working.

I have a separate routine called end_trial, where a trigger is sent when the previous routine is finished and this works fine. However, I would like to have one specific trigger appearing for the trials where the mouse has been clicked and the trial has been ended prematurely and another trigger which appears when the trial has ended on its own and the mouse was not clicked.

Could anyone give me a clue why the end_trial_mouse_2.status == STARTED is not working and suggest a solution?

Thank you very much in advance!

All the best,

Hi @VVV,

you can detect, whether the mouse was clicked using $end_trial_mouse_2.getPressed()[0], which returns True as soon as the left mouse button is pressed.