Error with mouse responses
Dear Forum,
I recently changed the response mode in my experiment from a keyboard to a mouse response. The participants are intended to select one of two alternatives presented on screen by clicking on the left vs. right mouse button. The position of the mouse is not relevant in this experiment.
When participants are not answering, they are receiving an answer reminder after 30 seconds. Unfortunately, I am receiving the following error when trying out the answer reminder:
- TypeError: cannot unpack non-iterable NoneType object
I am using the following function for my mouse responses:
my_mouse = Mouse(buttonlist=[1,3], timeout=mouse_timeout)
and collect responses like this:
button, (x, y), time = my_mouse.get_click()
And this is the if statement I am using to display the answer reminder:
if button is None:
my_canvas["answer_reminder"].color = "#f5f3ea"
my_canvas.show()
button, (x, y), time = my_mouse.get_click()
my_canvas["answer_reminder"].color = "#4C4E52"
my_canvas.show()
When using the if statement with a keyboard response, it worked perfectly so I assume that I got something wrong about the mouse responses. Do you have any recommendations about how I could solve this issue?
And in addition, do I always have to collect the position (x,y) when collecting a mouse response or is there any way I can leave that out?
Thanks a lot in advance :)
Best,
Sarah
Comments
Hi @sarah_alexandra ,
I guess @eduard already answered your question here, right?
Cheers,
Lotje
Did you like my answer? Feel free to