This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
Keyboard event lookup fails for Escape key #1072
Labels
sunset
Issues/PRs auto-closed when repo was archived
When registering a shortcut with goog.ui.KeyboardShortcutHandler for the escape key with a key name, one must use 'esc' instead of 'escape', since the goog.events.KeyNames does not have 'escape'. However, the real key name used by most modern browsers (exception being IE and Edge) for the escape key is "Escape" (per spec). So when a shortcut is registered and the escape key is pressed in a newer browser, the lookup for a registered key named "Escape" fails, and it instead falls back to using the keyCode.
This is a problem since keyCode is deprecated and some testing libraries expect to be able to create KeyboardEvent objects using the spec'ed name for this key: 'Escape'
The text was updated successfully, but these errors were encountered: