Capture a key press
Give the page focus, then press one key. The tester updates its display with properties from the keyboard event delivered to the page. The result represents an event, not a pasted text string. Modifier state and the active keyboard layout can therefore affect the value reported by key even when the same physical key is pressed.