Recording data for left and right mouse clicks

OS: Win10
PsychoPy version: 1.84.2
Standard Standalone - Y
What are you trying to achieve?
I am using a mouse component for a flanker task. I want participants to be able to use the left and right mouse buttons to indicate whether the stimulus (an arrow) is pointing left or right.
What did you try to make it work?
I have added the mouse component to the routine. In the correctAns condition I have put mouse.leftButton and mouse.rightButton.
What specifically went wrong when you tried that?:
There doesn’t seem to be any data for whether the participant has pressed the left or right mouse button. There are multiple number in the mouse.time column in the data file.

I think I need to add a code component, but I haven’t been able to find anything online about what I would need to put in - any advice would be greatly appreciated!

Hi, thank you for your sharing. Are you able to solve the problem now?