![Thomas Steiner](https://web.dev/images/authors/thomassteiner.jpg) Thomas Steiner [GitHub](https://github.com/tomayac) [LinkedIn](https://www.linkedin.com/in/thomassteinerlinkedin) [Mastodon](https://toot.cafe/@tomayac) [Bluesky](https://bsky.app/profile/tomayac.com) [Homepage](https://blog.tomayac.com/)

<br />


Published: September 10, 2024, Last updated: March 17, 2026

<br />

> [!WARNING]
> **Warning:** We have decided not to launch the Keyboard Lock and Pointer Lock permissions. Experiment data showed no clear benefit for users on scam sites and found that the permission modal frequently caused confusion on legitimate sites.

The [Keyboard Lock API](https://developer.mozilla.org/docs/Web/API/Keyboard/lock) lets developers provide an immersive, full screen experience for a variety of use cases, including interactive websites, games, and remote desktop or application streaming. It does so by enabling websites to use all available keys allowed by the host operating system.

The [Pointer Lock API](https://developer.mozilla.org/docs/Web/API/Pointer_Lock_API) lets a desktop application hide the pointer icon and interpret mouse motion for something else, like looking around in a 3D world.

From Chrome 131, using either of these two APIs requires permission. You can *check* for permission as shown in the following snippets:

```javascript
const {state} = await navigator.permissions.query({name: 'pointer-lock'});
if (state === 'granted') {
  // The Pointer Lock API can be used.
}
```

```javascript
const {state} = await navigator.permissions.query({name: 'keyboard-lock'});
if (state === 'granted') {
  // The Keyboard Lock API can be used.
}
```

There's no explicit need to *ask* for permission. If permission wasn't granted before, the browser will show a permission prompt upon the first request to lock the pointer or the keyboard.

![Keyboard Lock API permission prompt.](https://developer.chrome.com/static/blog/keyboard-lock-pointer-lock-permission/keyboard-lock.png)

![Pointer Lock API permission prompt.](https://developer.chrome.com/static/blog/keyboard-lock-pointer-lock-permission/pointer-lock.png)