psychopy.org | Reference | Downloads | Github

Mouse temporary appears on screen after set to invisible

I’m running a couple of online experiments. All of them are run in fullscreen and the mouse is set to be invisible by using this code at the beginning of the experiment.

// Hide cursor
document.body.style.cursor='none';

I’ve run around 30 participants and around 5 people reported that the mouse went visible during part of the experiment and then disappeared again after some trials. Also, most of them were using a Mac and Google Chrome and one of them was using Windows 10. I really don’t know how to look more deeply into this as I don’t see any patter in the people that reported seeing the mouse pointer. Any thoughts?

Hey @niclai, could you try adding <style>* { cursor: none; }</style> inside of <head> in your index.html? Could you send me a link to your study if that doesn’t work? Thanks, s.

Hi @sotiri, would this work even though I keep also this custom code?

// Hide cursor
document.body.style.cursor='none';

Right now is hard to tell whether it works because only some people (mostly using Mac machines) are reporting the mouse being visible during some trials. Do you think I can keep both codes?

Does it matter where in the header? I added after the end.

<head>
    <title>br-len-del [PsychoPy]</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="user-scalable=no">

    <!-- styles -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css">
    <link rel="stylesheet" href="https://lib.pavlovia.org/psychojs-2020.1.css">
    <script>* { cursor: none; }</script>

</head>

And the last thing, do you know whether I can log the mouse visibility? I added a question to be answered by the participant, but it would be nice if there is a way to automatically log the mouse pointer visibility. Thanks a lot for the help.

Sorry that was a typo, the wrapping tag should be <style> instead of <script> (corrected in my original reply). Placing that at the very end of <head> like you have should be fine, thanks, s.

Sorry when you say log mouse visibility, do you mean as part of the data that gets saved on exit? Do you mean CSS visibility?

Sorry, I missed another part of your question, yes that would override your custom code and your custom code would not be required then, provided that it all works as expected of course!

Ok, so this indeed hides the mouse. I removed the old code.

My other question has to do with the fact that some participants, under no very clear patter (maybe Macs along with Chrome), reported seeing the mouse pointer at some point during the experiment although it was invisible at the beginning. Is there a way to log the visibility status of the mouse? Or something similar, so I can filter people afterwards.