Skip to main content

Function: normalizeKey()

normalizeKey(key): string

Defined in: src/interaction/KeyboardInput.ts:92

Normalize a raw KeyboardEvent.key or a user query to a canonical, lowercase name. 'ArrowUp', 'W', and ' ' become 'arrowup', 'w', and 'space', so a held key reads back under any common spelling.

Parameters​

key​

string

A raw key name.

Returns​

string

The canonical key name.