p5.js exitPointerLock() Function
The function exitPointerLock() quit the previously used Pointer Lock for example if the pointer is locked then it unlock it and vice-versa. It is used to exit the pointer lock which is called by requestPointer() function.
Step 1: Open the web editor of p5.js https://editor.p5js.org/
Step 2:Write the following code and see the result.
In output, we can see that when the mouse is released it exit the previous pointer lock because we have set the mouseReleased() function to exit the pointer lock.