Keyboard layout map
Which character each physical key produces, revealing QWERTY, AZERTY, QWERTZ, Dvorak etc.
In one line
Can tell your keyboard layout, such as QWERTY, AZERTY or QWERTZ
Which character each physical key produces, revealing QWERTY, AZERTY, QWERTZ, Dvorak etc.
Tells native keyboard layout and so likely country and language (French AZERTY, German QWERTZ, Colemak enthusiasts). Chromium returns about 48 key codes, no prompt.
What it can and can't do
What the user does: Nothing. It happens when the page or app loads
It can
- Check which letter each physical key types, about 48 keys
- Guess your country and language from the layout
- Match shortcuts to your keyboard
It cannot
- See what you type
- Work in Firefox or Safari
- Show a permission pop up; there is none
How it differs between platforms: Only Chrome, Edge and Samsung Internet support it. Firefox and Safari do not.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 69 | 2018-09-04 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Not supported | Not available | Not listed | Standards position: harmful |
| Safari | Not supported | Not available | Not listed | Standards position: oppose |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Not supported | Not available | Not listed | None |
| Samsung Internet | Supported | 10.0 | 2019-08-22 | None |
How a site asks for it
| API | await navigator.keyboard.getLayoutMap() |
| Permissions policy | keyboard-map |
| Browser compat keys | api.Keyboard.getLayoutMap |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| How long it lasts | read fresh on every page load; nothing stored |
| How to take it back | none needed (no grant) |
| Inside an iframe | Readable from cross-origin iframes too (same values) |
Typical flow
- Page script reads the value
- No prompt is shown
Data you get
Shape: object
How often: static per session
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
KeyA..KeyZ, Digit0..9, punctuation | map | None | about 48 entries: code to character | Not listed |
Technical limits
- Chromium desktop only
- Top-level frame or allowed iframe
- Reports layout, not typed text
The story
What it is
The page can tell whether your keyboard is QWERTY, AZERTY or something else.
For you
You may see correct keys shown in a game or editor. You do not see that the site learned your layout. No prompt appears.
For makers
Makers use it to place game keys and shortcuts well. Trackers use it to guess your country and language and to tell you apart from others.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A browser game shows 'Z Q S D' as movement keys for a French player. | Krunker.io |
| creative | A music web app maps its piano keys to your physical key rows. | BandLab |
| productivity | A web editor shows the right shortcut hints for your layout. | None named |
| analytics | A fingerprinting script adds the layout to a device profile. | None named |
| security | A fraud tool flags a mismatch between layout and the claimed country. | None named |
| ads | An ad profile guesses language from an uncommon layout when other signals are missing. | None named |
Risks
- Hints at country
- Part of a fingerprint
Good uses and abuse
Legitimate uses
- Show correct shortcut hints
Known abuse
- Layout fingerprint
- Region inference
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 3.5 | Rough identifying entropy, when known |
History
- 2018-09, Chrome 69: Shipped, top-level frames and permissions-policy keyboard-map gated
Sources
How well checked: Based on official documentation.