| Reference | Downloads | Github

Feedback if mouse response times out

I know there have been a lot of threads on giving feedback and I read them, but still can’t get the feedback to work.
I want participants to respond quickly so on practice trials I want a message that says “too slow” if they don’t click the mouse fast enough.

I added the following code component:

In begin Experiment:


In Begin routine:

if mouseresppractice == -1 :
    msg="Too slow!"
msg="good job!"

I also tried:
if mouseresppractice <6 :
    msg="Too slow!"
if not mouseresppractice  :
    msg="Too slow!"

The feedback always says Good Job, how do I make it give “too slow” if there is no response?

Hi @agata, I think you just need to figure out how to get the responses from the mouse. What you are doing right now will not work. You want to look at the mouse documentation to see how to get responses from a mouse:

For example, if you want to know if a mouse button has been pressed, use:

resp = mouseresppractice.getPressed()  

# getPressed() returns 3 item list of responses , left, middle and right mouse button
# If no buttons were pressed, you get [0, 0, 0]
# If left mouse button was pressed, you get [1, 0, 0]

# check if left mouse button pressed:
if resp[0] == 1:
    print("The left mouse button was pressed")