I have a task where I am trying to hit a target inside a circle. When I click, the custom cursor “+” should turn green for 0.2 seconds and then I receive feedback. To achieve this, I have a custom code of:
fdbk_to_draw = []
vmend = visual.CustomMouse(win, visible=True)
green_pointer = visual.TextStim(win, text='+', height=0.04, color=(0, 255, 0))
vmend.pointer = green_pointer
#feedback
if mouse.isPressedIn(target):
fdbk = 2
fdbk_target = visual.TextStim(win=win, text='HIT', pos=[0.0, 0.0])
fdbk_to_draw = fdbk_target
vmend.draw()
win.flip()
core.wait(0.2)
elif mouse.isPressedIn(circle):
fdbk = 1
fdbk_circle = visual.TextStim(win=win, text='CLOSE', pos=[0.0, 0.0])
fdbk_to_draw = fdbk_circle
vmend.draw()
win.flip()
core.wait(0.2)
else:
fdbk = 0
fdbk_miss = visual.TextStim(win=win, text='MISS', pos=[0.0, 0.0])
fdbk_to_draw = fdbk_miss
vmend.draw()
win.flip()
core.wait(0.2)
In the next routine, I have:
circle.opacity = 0
circle.draw()
fdbk_to_draw.draw()
win.flip()
The problem I am running into right now is that the feedback is constantly staying at 0/MISS no matter where I click. For more confusion, the feedback actually works when the green_cursor custom mouse component is taken out. Any thoughts?