pointerlockchange
Disponibilidad limitada
Esta característica no es Baseline porque no funciona en algunos de los navegadores más usados.
¿Quieres que más navegadores sean compatibles con esta característica? Cuéntanos por qué.
El evento pointerlockchange es disparado cuando el cursor del navegador es bloqueado o desbloqueado.
Información general
- Specification
- Interface
-
Event
- Bubbles
-
Yes
- Cancelable
-
No
- Target
-
Document
- Default Action
-
None
Propiedades
| Property | Type | Description |
|---|---|---|
target Read only |
EventTarget |
The event target (the topmost target in the DOM tree). |
type Read only |
String |
The type of event. |
bubbles Read only |
Boolean |
Whether the event normally bubbles or not. |
cancelable Read only |
Boolean |
Whether the event is cancellable or not. |
Ejemplo
js
//Ten en cuenta que el nombre del evento, en este caso "pointerlockchange" puede variar según el navegador.
document.addEventListener("pointerlockchange", function (event) {
// El objetivo, parámetro "target", del objeto "event" es siempre el objeto "document".
// para recuperar el objeto que recibe el bloqueo/desbloqueo es document.pointerlockElement.
document.pointerLockElement;
});