Skip to Content
Platform.Ontology

Keyboard layout map

Which character each physical key produces, revealing QWERTY, AZERTY, QWERTZ, Dvorak etc.

Gets silentlyLanguage and settingsInputWeb browsersWhen the page loadsWhile you use it

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

BrowserStatusFirst versionReleasedNote
ChromeSupported692018-09-04None
EdgeSupported792020-01-15None
FirefoxNot supportedNot availableNot listedStandards position: harmful
SafariNot supportedNot availableNot listedStandards position: oppose
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidNot supportedNot availableNot listedNone
Samsung InternetSupported10.02019-08-22None

How a site asks for it

APIawait navigator.keyboard.getLayoutMap()
Permissions policykeyboard-map
Browser compat keysapi.Keyboard.getLayoutMap
How access is grantednone
What the user seesNone
Needs a secure context (HTTPS)Yes
Needs a user gestureNo
How long it lastsread fresh on every page load; nothing stored
How to take it backnone needed (no grant)
Inside an iframeReadable from cross-origin iframes too (same values)

Typical flow

  1. Page script reads the value
  2. No prompt is shown

Data you get

Shape: object
How often: static per session

FieldTypeUnitRangePrecision
KeyA..KeyZ, Digit0..9, punctuationmapNoneabout 48 entries: code to characterNot 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

TypeExampleApps
gamesA browser game shows 'Z Q S D' as movement keys for a French player.Krunker.io
creativeA music web app maps its piano keys to your physical key rows.BandLab
productivityA web editor shows the right shortcut hints for your layout.None named
analyticsA fingerprinting script adds the layout to a device profile.None named
securityA fraud tool flags a mismatch between layout and the claimed country.None named
adsAn 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

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility2 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits3.5Rough 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.

On this page