psychopy.org | Reference | Downloads | Github

Reaction to klick

Hi Guys, I´m trying to create a reaction after the participant clicks left or right.
If he clicks left the plot “a” should be shown and if he clicks right plot “b”.
is this possible with the builder?

Hi @FaceIt, yes, you can use the getPressed mouse method, which returns a 3-item list indicating whether or not buttons 0,1,2 are currently pressed. In the list returned by this method, 1 means pressed, 0 means not pressed.- see docs . In a code component you can check whether left or right mouse button has been pressed. In the “Each Frame” tab of the code component:

if mouse.getPressed()[0] == 1:  # left button
    # present image A
elif mouse.getPressed()[2] == 1:  # right button
    # present image B

Hi @dvbridges May I rephrase it:
At the end of ne plot there will be a screen with two options and the participant has to move the mouse and choose one of them.
So Option A should Link to Table A and Option B to Table B.