psychopy.org | Reference | Downloads | Github

Implement something Pointer/Mouse Lock

I would like to hide the mouse during my experiment and I also need to reset the position of the mouse in certain trials. I read that mouse.setPos() is actually not available in PsychoJS.

Would it be possible to implement something like a Pointer/Mouse lock by adding custom JS to my experiment? Something like what is described here:

Here is a demo from the firefox API (https://mdn.github.io/dom-examples/pointer-lock/).

I’ve not tested on Pavlovia yet but if you can use mouse = event.Mouse(visible=False) then you should be able to display a replacement pointer at a given offset from where the mouse really is.

I wrote a game on PsychoPy using this in 2017 – I’ve just checked and it still works locally so I’ll upload it to Pavlovia at some point.