KeyboardEvent Key Normalizer

JSON →
library 1.1.0 ·javascript
verified May 27, 2026

`keyboard-key` is a lightweight utility library designed to provide a consistent and reliable way to determine the `KeyboardEvent.key` property from keyboard events across different browsers, addressing inconsistencies in native browser implementations. Released as version 1.1.0, this package aims to normalize keyboard event key values, stepping in where `KeyboardEvent.key` lacked full cross-browser support or where older, deprecated properties like `keyCode` and `which` were still in use. It differentiates itself by attempting to infer key values, including interpreting shift key presses, which, while helpful for `en-US` layouts, introduces a locale-specific caveat. The library also offers `getCode()` for obtaining normalized `keyCode` values and provides constants for common key codes, promoting the use of modern `KeyboardEvent.key` semantics while providing a fallback.

total hits 9
actors 5 distinct systems
last hit 7d ago Script
GPTBot
2
Script
1
Search engines
1

top countries 🇨🇦 Canada · 🇺🇸 United States · 🇫🇷 France · 🇩🇪 Germany