OS (e.g. Win10): macOS 10.5 PsychoPy version (e.g. 1.84.x): 3.1.5 Standard Standalone? (y/n) Yes What are you trying to achieve?: I want to measure the response time of the participant clicking a visual.ButtonStim.
What did you try to make it work?: I tried using the mouse component and putting the name of the button stim into the ‘clickable stimuli’ field in the mouse component.
What specifically went wrong when you tried that?: Mouse.time in the output measures the time of any mouse click on the screen, not only on my button stim (which is what I want to achieve).
I am new to PsychoPy and I would be very grateful for any suggestions on how I can achieve this or any insights on what I might not have understood correctly.
Hi @dvbridges, thank you for your reply. I have not selected to end the routine on “valid click” because this is not supposed to happen as the participants have a certain amount of time for this routine and should be able to change their decision during that time. Is there a way to store the response time of the last click on the button?
If you want the mouse response saving on the button click, you can use the following code in the Each Frame tab of a code component:
if <yourButton>.buttonClicked():
thisExp.addData("mouse.trial_time", t) # Save time relative to start of trial
thisExp.addData("mouse.mouse_time", mouse.mouseClock.getTime()) # Save time relative to start of mouse
continueRoutine = False
if ButtonLeft.buttonClicked():
TypeError: buttonClicked() missing 1 required positional argument: 'mouse'
Just to be clear what I want to achieve: In this routine, I have two button stims called ButtonLeft and ButtonRight. Participants have eight seconds to click any one of those buttons or press one of them and then change their decision and click the other button. The last button press in this routine is the one that I am interested in as the button that is selected at the end of the routine is the participant’s valid decision.
I appreciate your help!