Reset mouse position to center in OSWeb
Hi all,
Several people have asked me whether it's possible to reset the position of the mouse cursor to the center in OSWeb. This is not possible, because for security reasons you cannot change the mouse-cursor position through JavaScript. (Imagine the consequences if this were possible!)
As a workaround, you can have participants click on the center of the screen, and only continue the experiment when they've clicked sufficiently close to the center. I attached an example script below. The downside is that this disrupts the flow of the experiment, so use with caution!
Cheers,
Sebastiaan


Comments
Hello Sebastiaan,
I can't download this file. Can you upload it again plz?
Thanks!
Best,
Han
@kiwifoxb612 You can download it again through the link above!
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi @sebastiaan,
this is a very helpful information!
Maybe it is worth considering to put this info into javascript common functions of the manual in the website which is where i searched first.
Maybe to add: there is no function Mouse.set_pos(pos=(0, 0)) in javascript, but a workaround.
Stephan