javascriptgoogle-chromepointerlock

Disabling mouse acceleration not supported in Chrome v88


So we use the requestPointerLock() function to lock the mouse pointer of users while gaming on our website. Following the web.dev disable-mouse-acceleration article, I tested their pointer lock API sample and discovered that requesting pointer lock with "unadjustedMovement" works on my Chrome browser (v88.0.4324.104).

However, now something strange is happening. I basically just copied the above project by going to the source code link and click on "remix to edit". Then, I opened the sample and did the same test, resulting in the following message:

disabling mouse acceleration not supported

So basically, two identitcal project code where the original works flawlessly, but the copied project says disabling mouse accelaration is not supported.

Also, I've tested the exact same code in a local project, but same error message is returned.

Anyone an idea what's going wrong here?

The original source code
The original live test

The source code copy
The live test copy


Solution

  • UPDATE: It is supported by default in chromium browsers from v92

    Old answer:

    It is supported but only with flag

    Just go to chrome://flags/#enable-pointer-lock-options and select enabled. After relaunch go to https://unadjusted-movement.glitch.me/ and test it