Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Too many mouse clicks required for mouse response

edited November 2017 in OpenSesame


I have a problem with my experiment.
I need to press the mouse button 1 three times - only after three times it moves to the next trial.
Before I wrote this code below on python inline script - one click was enough. Please if you have a suggestion I would like to hear.
I wrote this code on the run stage and the prepare stage.
if I erase it from prepare stage it still requires two clicks.

my_mouse = mouse()
button, (x, y), timestamp = my_mouse.get_click(timeout=99000)
if button is None:
    print('A timeout occurred!') 


  • Hi Matanel,

    You should include this code only in the Run phase. If you then still need multiple mouse clicks, this is because there is some other item that collects a mouse click as well. Did you set any sketchpad durations to 'mouselick', or insert a mouse_response item somewhere?


    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

  • Oh shit. I haven't actually sent my response. Well, for completeness sake:

    Without seeing the rest of your experiment, it is hard to say what is going on, but somewhere in your code or in your structure, you wait for another mouse click. Maybe it is in the code, maybe it is with a mouse response item.

    Again, if you want to have a clear diagnosis, we need more infromation.


  • Thanks guys, but I didn't set any sketchpad durations to 'mouselick', or insert a mouse_response item somewhere.
    I attach my experiment file - can you open it ?

  • You don"t need to add a mouse response item if you use inline_scripts to sample a mouse response (or the other way around). So delete whichever you don't need, (probably the mouse response item).


  • edited November 2017

    Thanks a lot Eduard now I realy need only one click.

    But now I am stuck - can't make the cursor visible - I tried this code:

    and also this :

    but still the cursor doesn't appear on the sketch-pad like the mouse_response is doing.

    I tryied to manage the back end settings like sabastian is suggesting here:

    One solution is to **not ** write in the inline script
    my_mouse = mouse()
    button, (x, y), timestamp = my_mouse.get_click(timeout=99)

    but if I use the mouse response I can only use the var.cursor_x - but the problem with this variable is that
    I can't do any manipulations on the output x of the click.

    and another problem with this variable is that it gives me different x coordinates from my_mouse.get_click

    Thanks for your patience .

  • Hi,
    Instead of show_cursor(show=True) try, set_visible(show=True)


  • edited December 2017

    Not working.
    show_cursor(show=True) - works as for about a second that I press the mouse and then disappears.
    I am thinking about drawing a sketchpad in the inline script. Do you think it may solve this?
    Do you have some recommendation for how to do it?

  • Hi matanel,

    Could you please upload your experiment? I think, I could help you quicker like that.


Sign In or Register to comment.