[][src]Static p5_sys::global::exitPointerLock

pub static exitPointerLock: ExitPointerLockInternalType

The function exitPointerLock() exits a previously triggered pointer Lock for example to make ui elements usable etc

Examples

//click the canvas to lock the pointer
//click again to exit (otherwise escape)
let locked = false;
function draw() {
  background(237, 34, 93);
}
function mouseClicked() {
  if (!locked) {
    locked = true;
    requestPointerLock();
  } else {
    exitPointerLock();
    locked = false;
  }
}