WORKED CASE · SYNTHETIC TEST DATA

Compare logical and physical keys

Keyboard layout affects key values independently from physical key positions.

Input and settings

Press A without Shift on a US layout

Run and interpret

Focus the page and press A. A US layout produces logical a and physical KeyA.

Expected output

KeyA

Scope and possible misuse

Reserved browser shortcuts may not reach the page. Legacy numeric keyCode and which are not portable identifiers.

Unexpected result? Report a minimal example