Howdy, Stranger!

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

Supported by

Touchscreen make the mouse invisible before first touch

Dear folks,

for a new experiment i will use a touchscreen. For this i am using the mouse functions.

However, before the first 'touch or mouseclick' it seems impossible to make the mouse invisible.

I have tried my_mouse = Mouse(visible=False). In this case the mouse is not visible, but i does not collect mouseclicks either and therefore the experiment gets stuck. Same for Mouse.show_cursor(False).

This occurs only for the first mouse click. Afterwards i can set it to False and everything works fine. It looks weird to see a mouse if you are supposed to touch with your fingers. I was wondering whether i can change the color of the mouse for the first occurence to white (as my background color). Do you know how to do that? Any further suggestions?

I am using the OS 3.2.8 with Expyriment backend and only inline scripts as always ;)

Thanks in advance,



  • Hi Stephan,

    Changing the color of the mouse is not possible easily (OS calls the system mouse), but you could try to have a mock click. I don't know exactly what is happening under the hood, but if you check the code for mouse.get_click(), you might be able to identify the function call that causes the mouse to disappear, and manually call the function as the very first thing in your script. Check github for the code!

    Does that make sense?


  • Hi Eduard,

    i now found out that my other post also has to do with same problem. This is great because it reduces my problems to only one ;)

    Here is what i found out about the other post. I was able to collect touchscreen 'clicks' without seeing the mouse by using my_mouse = Mouse(visible=False).However, the (x,y) coordinates of the following clicks were not correct. To me they appeared quite random. Additionally, -960 for x and -540 for y appeared very often (I did not touch the edges of the screen). Well, i solved the other problem by setting my_mouse = Mouse(visible=True).

    Still, i am not able to make the mouse invisible. I also tried mouse().show_cursor(False), but it has no effect. With github do you mean this?

    Another idea: Is it possible to set the mouse behind my stimulus picture?

    Best regards,


  • Hi Stephan,

    Sorry for the delay. I mean this file:

    However, the (x,y) coordinates of the following clicks were not correct.

    This sounds to me, as if the screen is shifted systematically. Can you find out in which direction the shift occurred and whether it is indeed systematic. If so, you could subtract the shift, and would have correct click coordinates.

    I'm a little confused. Did you now manage to hide the mouse or not? You say both things here, sort of...



  • Hi Eduard,

    the link seems to be for the droid backend right? I am using xperiment backend on a usual computer. Only the screen is special and has the additional function of touch ;)

    I do not believe that the screen is 'shifted'. It looks more like the left up edge of the screen is logged for the x,y coordinates if i set the mouse invisible.

    Yes, i managed to hide the mouse. However, if i do so the x,y coordinates are not correct. In contrast, if i show the mouse they are correct. The coordinates are important for me, so hiding the mouse with incorrect values is not a solution. Does this make sense?


Sign In or Register to comment.