Hiding mouse cursor in the pavlovia online experiment

Hello, so to hide the cursor while running both online and offline what I did for the code component is to make it “both” instead of the automatic “auto → JS”. This way you can write out the python code that hides the mouse offline while also editing/writing the JS code on the right side for it to run offline. I did this and my experiment runs both offline and in Pavlovia!

Just as a refresher to hide the mouse use this Py code on the left side:

win.mouseVisible = False

And write this out on the right (JS) side:

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

To make the mouse visible:

win.mouseVisible = True
document.body.style.cursor='auto';

Hope this helps!

8 Likes