I'm creating an experiment using the PsychoPy coder and am not sure how to implement multiple mouse clicks. In the experiment, there are multiple targets and distractors and during a response period, individuals are to select the targets. However, I currently have it where if you click on one of the targets, you get a correct message, otherwise you get an incorrect message. I also have a function that will wait for a mouse click to find the reaction time and will give the response after the mouse click. How do I add multiple mouse clicks for multiple targets?
def waitForMouse(mouse):
mouse.clickReset()
buttons = mouse.getPressed()
while buttons[0] == False: #wait for mouse click
buttons, times = mouse.getPressed(getTime=True) #get reaction time when mouse clicked
return times[0]
if clock.getTime() >= stimDuration: #start of response period
ResponsePrompt.draw() #indicate to participant to select targets
win.flip()
rt = waitForMouse(myMouse)
if myMouse.isPressedIn(target[0]) or myMouse.isPressedIn(target[1]):
CorrectResp.draw() #selected one of the correct targets
win.flip()
core.wait(2) #allow them to read it
else:
IncorrectResp.draw() #answered incorrectly
win.flip()
core.wait(2)