Keyboard Lock
Captures keys like Escape and Alt+Tab while in fullscreen.
In one line
Can capture keys like Escape and Alt+Tab while the page is full screen
Captures keys like Escape and Alt+Tab while in fullscreen.
Lets games and remote desktops receive keys the browser normally keeps, so a site can trap Escape or Ctrl+W. Works only in fullscreen; a long-press of Escape always exits.
What it can and can't do
What the user does: You tap a full screen button in a game or remote desktop
It can
- Take over keys the browser normally keeps, such as Escape or Alt+Tab
- Pass those keys to a game or remote desktop session
- Do this only while the page is in full screen
It cannot
- Trap you for good; holding Escape for about 2 seconds always lets you out
- Capture keys when the page is not full screen
- Work in Firefox or Safari
- Capture the operating system's own protected shortcuts like Ctrl+Alt+Delete
How it differs between platforms: Chrome and Edge support it on desktop. Firefox and Safari do not.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 68 | 2018-07-24 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 68 | 2018-07-24 | None |
| Samsung Internet | Not supported | Not available | Not listed | None |
How a site asks for it
| API | navigator.keyboard.lock(['Escape', 'KeyW']); unlock() |
| Permissions policy | keyboard-map |
| Browser compat keys | api.Keyboard.lock |
| How access is granted | gesture |
| What the user sees | No prompt; works only while the page is in fullscreen. |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | Yes |
| How long it lasts | While in fullscreen |
| How to take it back | Exit fullscreen or long-press Escape |
| Inside an iframe | Frames inherit fullscreen |
Typical flow
- Enter fullscreen
- keyboard.lock(keys)
- Locked keys sent to the page
- Hold Escape 2 seconds to exit
Data you get
What comes back: Key capture mode
Shape: none
How often: while fullscreen
No individual data fields. The signal is the access itself.
Technical limits
- Fullscreen only
- Cannot capture Ctrl+Alt+Del or OS shortcuts
- Chromium only
The story
What it is
Lets a page grab keys like Escape and Alt+Tab when full screen.
For you
You go full screen in a game or remote desktop and keys like Escape go to the game instead of closing it. A message usually says 'Hold Escape to exit full screen'. You feel the page has taken over your keyboard.
For makers
Cloud games and remote work tools need every key to reach the remote computer. Without it, a press of Escape or Alt+Tab would break the stream. Makers also like how it keeps players inside the app.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A cloud gaming stream sends Escape, Alt and Windows keys to the remote PC, so an in game menu opens instead of exiting full screen. | GeForce NOW, Xbox Cloud Gaming |
| enterprise | A remote desktop in the browser forwards Alt+Tab and Ctrl+W to the remote Windows machine. | Azure Virtual Desktop, Amazon WorkSpaces, Chrome Remote Desktop |
| games | A browser strategy or shooter game uses Escape for its pause menu while full screen. | Krunker.io |
| education | An online exam tool locks a student in full screen so keys cannot switch tabs. | None named |
| creative | A web video editing or 3D tool receives all shortcuts while in full screen. | None named |
| security | A bad page could try to trap you in full screen, which is why the browser shows a hold to exit message. | None named |
Risks
- Can trap you in full screen
- Fake lock screens
What the platform says
- MDN (standards docs): Keyboard Lock. Describes a way for web apps in full screen to capture keys the browser normally keeps, helpful for games and remote desktops.
Good uses and abuse
Legitimate uses
- Games
- Remote desktop
Known abuse
- Trapping people in a fullscreen scam page
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2018-07, Chrome 68: Keyboard Lock ships
Related capabilities
Related
- Keyboard Map (layout leak). Can tell your keyboard layout, which hints at your country and language
- Fullscreen API. Can fill your whole screen after you tap, with a clear way out
Sources
How well checked: Based on official documentation.