UI Events KeyboardEvent key Implementation Report

Editor’s Draft,

More details about this document
This version:
https://w3c.github.io/uievents-key/impl-report.html
Issue Tracking:
GitHub
Editor:
(Google)

Abstract

This document reports on implementations of the [UIEvents-Key] specification.

Status of this document

This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.

This document was published by the Web Applications Working Group as an Editors Draft. This document is intended to become a W3C Recommendation.

This document was published by the Web Applications Working Group as a Working Draft. Feedback and comments on this specification are welcome. Please use GitHub issues Historical discussions can be found in the public-webapps@w3.org archives.

Publication as an Editors Draft does not imply endorsement by W3C and its Members. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 2 November 2021 W3C Process Document.

1. Introduction

The [UIEvents-Code] specification defines the set of values that are valid for use in the key attribute.

This document summarizes the current implementation status of the key attribute and its values.

The following versions of each user agents were tested:

2. Methodology

Because there is no automated way to test these key press events (expecially considering that international keyboard are often required), these tests were all performed manually.

There are two kinds of required values for this attribute: Unnamed and Named.

Manual tests were performed by visiting the domeeventviewer.com/key-event-viewer.html test page and examining the "key" column after pressing the key being tested. To test keys (like "AltGraph") that are only present on keyboards for certain locales, this requires using a keyboard from a locale that contains the key being tested.

For purposes of this report, Chrome, Firefox and Safari are considered independent implementations.

3. Results

3.1. Summary

Manual tests for all 63 of the sampled Unnamed and all 38 of the Named required values of the key attribute Pass in at least 2 independent implementations.

The Candidate Recommendation exit criteria are therefore fulfilled.

In addition, the specification describes a number of optional Named values that may be used to support multimedia or legacy keyboards. Of these, manual tests confirm that 39 of these Pass in at least 2 independent implementations.

3.2. Raw Results

The following tables present the result of the manual tests.

Entries marked "Pass" generate the expected value when the corresponding key is pressed.

Entries marked "Fail" generate some value other than the expected value when the corresponding key is pressed. Wherever possible, a Note is included that provides more information about the failure.

Entries marked with a "?" have not been tested, typically because devices with that key were not available (for example, because keyboards with those keys are not supported on that platform).

3.2.1. The key Attribute

The key attribute (defined in [UIEvents]) is present in all browsers tested.

KeyboardEvent attribute Chrome Edge Firefox Safari Notes
key Pass Pass Pass Pass

3.2.2. Required Unnamed Keys

The key attribute can contain any character that can be produced by any key in any locale, so it is beyond the scope of this document to attempt to enumerate all possible values that can be contained.

This section provides a basic sampling of key types and identifies if those keys are generally supported by the user agent.

key attribute value Chrome Edge Firefox Safari Notes
"A"..."Z" Pass Pass Pass Pass
"a"..."z" Pass Pass Pass Pass
"0"..."9" Pass Pass Pass Pass
" " Pass Pass Pass Pass

3.2.3. Required Named Keys

This section lists the basic set of named key attributes that corresponds to values generated by a standard keyboard layout.

key attribute value Chrome Edge Firefox Safari Notes
"Unidentified" Pass Pass Pass Pass
Modifier Keys
"Alt" Pass Pass Pass Pass
"AltGraph" Pass Pass Pass ?
"CapsLock" Pass Pass Pass Pass
"Control" Pass Pass Pass Pass
"Meta" Pass Pass Pass Pass
"NumLock" Pass Pass Pass ?
"ScrollLock" Pass Pass Pass ?
"Shift" Pass Pass Pass Pass
Whitespace Keys
"Enter" Pass Pass Pass Pass
"Tab" Pass Pass Pass Pass
Navigation Keys
"ArrowDown" Pass Pass Pass Pass
"ArrowLeft" Pass Pass Pass Pass
"ArrowRight" Pass Pass Pass Pass
"ArrowUp" Pass Pass Pass Pass
"End" Pass Pass Pass Pass
"Home" Pass Pass Pass Pass
"PageDown" Pass Pass Pass Pass
"PageUp" Pass Pass Pass Pass
Editing Keys
"Backspace" Pass Pass Pass Pass
"Delete" Pass Pass Pass Pass
"Insert" Pass Pass Pass ?
UI Keys
"ContextMenu" Pass Pass Pass ?
"Escape" Pass Pass Pass Pass
"Pause" Pass Pass Pass ?
Device Keys
"PrintScreen" Pass Pass Pass ?
General-Purpose Function Keys
"F1" Pass Pass Pass Pass Chrome opens help page and doesn’t send keyup event
"F2" Pass Pass Pass Pass
"F3" Pass Pass Pass Pass Chrome/Firefox open Find bar. Chrome doesn’t send keyup event
"F4" Pass Pass Pass Pass
"F5" Pass Pass Pass Pass Chrome/Firefox refresh page
"F6" Pass Pass Pass Pass
"F7" Pass Pass Pass Pass Firefox enables/disables Caret Browsing.
"F8" Pass Pass Pass Pass
"F9" Pass Pass Pass Pass
"F10" Pass Pass Pass Pass
"F11" Pass Pass Pass Pass Chrome enters/leaves fullscreen
"F12" Pass Pass Pass Pass Chome/Firefox open/close debug console.

3.2.4. Optional Editing Named Keys

Since some of these values are dependent on specific keyboards, user agents are not not expected to support all of these values.

key attribute value Chrome Edge Firefox Safari Notes
Editing Keys
"Clear" Pass Pass Pass ?
"Copy" Fail Fail Fail ?
"CrSel" Pass Pass Pass ?
"Cut" Fail Fail Fail ?
"EraseEof" Pass Pass Pass ?
"ExSel" Pass Pass Pass ?
"Paste" Fail Fail Fail ?
"Redo" Fail Fail Pass ?
"Undo" Pass Fail Pass ?
IME and Composition Keys
"AllCandidates" Fail Fail Fail ?
"Alphanumeric" Pass Fail Pass ?
"CodeInput" Fail Fail Fail ?
"Compose" Fail Fail Fail ?
"Convert" Pass Pass Pass ?
"Dead" Fail Fail Fail ?
"FinalMode" Pass Fail Pass ?
"GroupFirst" Fail Fail Fail ?
"GroupLast" Fail Fail Fail ?
"GroupNext" Fail Fail Fail ?
"GroupPrevious" Fail Fail Fail ?
"ModeChange" Pass Pass Pass ?
"NextCandidate" Fail Fail Fail ?
"NonConvert" Pass Pass Pass ?
"PreviousCandidate" Fail Fail Fail ?
"Process" Pass Fail Fail ?
"SingleCandidate" Fail Fail Fail ?
IME keys specific to Korean keyboards
"HangulMode" Pass Fail Pass ?
"HanjaMode" Pass Fail Pass ?
"JunjaMode" Pass Pass Pass ?
IME keys specific to Japanese keyboards
"Eisu" Fail Fail Fail ?
"Hankaku" Pass Fail Pass ?
"Hiragana" Pass Fail Pass ?
"HiraganaKatakana" Fail Fail Fail ?
"KanaMode" Pass Pass Pass ?
"KanjiMode" Pass Pass Pass ?
"Katakana" Pass Fail Pass ?
"Romaji" Pass Fail Pass ?
"Zenkaku" Pass Fail Pass ?
"ZenkakuHankaku" Fail Fail Fail ?

3.2.5. Optional Device-specific Named Keys

This sections lists named key attributes that correspond to values generated by keys found on specialized keyboards, for example:

Because of the device-specific nature of these values, it is not expected that user agents will support all of these values

key attribute value Chrome Edge Firefox Safari Notes
Modifier Keys
"Fn" Fail Fail Fail Fail
"FnLock" Fail Fail Fail Fail
"Symbol" Fail Fail Fail Fail
"SymbolLock" Fail Fail Fail Fail
Legacy modifier keys
"Hyper" Fail Fail Fail Fail
"Super" Fail Fail Fail Fail
UI Keys
"Accept" Pass Pass Pass Fail
"Again" Fail Fail Fail Fail
"Attn" Pass Pass Pass Fail
"Cancel" Pass Fail Pass Fail
"Execute" Pass Pass Pass Fail
"Find" Fail Fail Fail Fail
"Help" Pass Pass Pass Fail
"Play" Pass Pass Pass Fail
"Props" Fail Fail Fail Fail
"Select" Pass Pass Pass Fail
"ZoomIn" Fail Fail Fail Fail
"ZoomOut" Fail Fail Fail Fail
Device Keys
"BrightnessDown" Fail Fail Fail Fail
"BrightnessUp" Fail Fail Fail Fail
"Eject" Fail Fail Fail Fail
"LogOff" Fail Fail Fail Fail
"Power" Fail Fail Fail Fail
"PowerOff" Fail Fail Fail Fail
"Hibernate" Fail Fail Fail Fail
"Standby" Pass Fail Pass Fail
"WakeUp" Fail Fail Fail Fail
General-Purpose Function Keys
"Soft1" Fail Fail Fail Fail
"Soft2" Fail Fail Fail Fail
"Soft3" Fail Fail Fail Fail
"Soft4" Fail Fail Fail Fail
Multimedia Keys
"ChannelDown" Fail Fail Fail Fail
"ChannelUp" Fail Fail Fail Fail
"Close" Fail Fail Pass Fail
"MailForward" Pass Fail Pass Fail
"MailReply" Pass Fail Pass Fail
"MailSend" Pass Fail Pass Fail
"MediaClose" Fail Fail Fail Fail
"MediaFastForward" Fail Fail Fail Fail
"MediaPause" Fail Fail Fail Fail
"MediaPlay" Fail Fail Fail Fail
"MediaPlayPause" Pass Fail Pass Fail
"MediaRecord" Fail Fail Fail Fail
"MediaRewind" Fail Fail Fail Fail
"MediaStop" Pass Fail Pass Fail
"MediaTrackNext" Pass Fail Pass Fail
"MediaTrackPrevious" Pass Fail Pass Fail
"New" Fail Fail Pass Fail
"Open" Pass Fail Pass Fail
"Print" Fail Fail Fail Fail Firefox returns PrintScreen; Chrome returns Undefined
"Save" Fail Fail Pass Fail
"SpellCheck" Fail Fail Fail Fail
Multimedia Numpad Keys
"Key11" Fail Fail Fail Fail
"Key12" Fail Fail Fail Fail
Audio Keys
"AudioBalanceLeft" Fail Fail Fail Fail
"AudioBalanceRight" Fail Fail Fail Fail
"AudioBassBoostDown" Fail Fail Fail Fail
"AudioBassBoostToggle" Fail Fail Fail Fail
"AudioBassBoostUp" Fail Fail Fail Fail
"AudioFaderFront" Fail Fail Fail Fail
"AudioFaderRear" Fail Fail Fail Fail
"AudioSurroundModeNext" Fail Fail Fail Fail
"AudioTrebleDown" Fail Fail Fail Fail
"AudioTrebleUp" Fail Fail Fail Fail
"AudioVolumeDown" Pass Fail Pass Fail
"AudioVolumeUp" Pass Fail Pass Fail
"AudioVolumeMute" Pass Fail Pass Fail
"MicrophoneToggle" Fail Fail Fail Fail
"MicrophoneVolumeDown" Fail Fail Fail Fail
"MicrophoneVolumeUp" Fail Fail Fail Fail
"MicrophoneVolumeMute" Fail Fail Fail Fail
Speech Keys
"SpeechCorrectionList" Fail Fail Fail Fail
"SpeechInputToggle" Fail Fail Fail Fail
Application Keys
"LaunchApplication1" Fail Fail Fail Fail
"LaunchApplication2" Fail Fail Fail Fail
"LaunchCalendar" Fail Fail Fail Fail
"LaunchContacts" Fail Fail Fail Fail
"LaunchMail" Fail Fail Fail Fail
"LaunchMediaPlayer" Fail Fail Fail Fail
"LaunchMusicPlayer" Fail Fail Fail Fail
"LaunchPhone" Fail Fail Fail Fail
"LaunchScreenSaver" Fail Fail Fail Fail
"LaunchSpreadsheet" Fail Fail Fail Fail
"LaunchWebBrowser" Fail Fail Fail Fail
"LaunchWebCam" Fail Fail Fail Fail
"LaunchWordProcessor" Fail Fail Fail Fail
Browser Keys
"BrowserBack" Pass Fail Pass Fail
"BrowserFavorites" Pass Fail Fail Fail Key handled by browser in Firefox
"BrowserForward" Pass Fail Pass Fail
"BrowserHome" Fail Fail Fail Fail
"BrowserRefresh" Fail Fail Fail Fail
"BrowserSearch" Fail Fail Fail Fail
"BrowserStop" Fail Fail Fail Fail
Mobile Phone Keys
"AppSwitch" Fail Fail Fail Fail
"Call" Fail Fail Fail Fail
"Camera" Fail Fail Fail Fail
"CameraFocus" Fail Fail Fail Fail
"EndCall" Fail Fail Fail Fail
"GoBack" Fail Fail Fail Fail
"GoHome" Fail Fail Fail Fail
"HeadsetHook" Fail Fail Fail Fail
"LastNumberRedial" Fail Fail Fail Fail
"Notification" Fail Fail Fail Fail
"MannerMode" Fail Fail Fail Fail
"VoiceDial" Fail Fail Fail Fail
TV Keys
"TV" Fail Fail Fail Fail
"TV3DMode" Fail Fail Fail Fail
"TVAntennaCable" Fail Fail Fail Fail
"TVAudioDescription" Fail Fail Fail Fail
"TVAudioDescriptionMixDown" Fail Fail Fail Fail
"TVAudioDescriptionMixUp" Fail Fail Fail Fail
"TVContentsMenu" Fail Fail Fail Fail
"TVDataService" Fail Fail Fail Fail
"TVInput" Fail Fail Fail Fail
"TVInputComponent1" Fail Fail Fail Fail
"TVInputComponent2" Fail Fail Fail Fail
"TVInputComposite1" Fail Fail Fail Fail
"TVInputComposite2" Fail Fail Fail Fail
"TVInputHDMI1" Fail Fail Fail Fail
"TVInputHDMI2" Fail Fail Fail Fail
"TVInputHDMI3" Fail Fail Fail Fail
"TVInputHDMI4" Fail Fail Fail Fail
"TVInputVGA1" Fail Fail Fail Fail
"TVMediaContext" Fail Fail Fail Fail
"TVNetwork" Fail Fail Fail Fail
"TVNumberEntry" Fail Fail Fail Fail
"TVPower" Fail Fail Fail Fail
"TVRadioService" Fail Fail Fail Fail
"TVSatellite" Fail Fail Fail Fail
"TVSatelliteBS" Fail Fail Fail Fail
"TVSatelliteCS" Fail Fail Fail Fail
"TVSatelliteToggle" Fail Fail Fail Fail
"TVTerrestrialAnalog" Fail Fail Fail Fail
"TVTerrestrialDigital" Fail Fail Fail Fail
"TVTimer" Fail Fail Fail Fail
Media Controller Keys
"AVRInput" Fail Fail Fail Fail
"AVRPower" Fail Fail Fail Fail
"ColorF0Red" Fail Fail Fail Fail
"ColorF1Green" Fail Fail Fail Fail
"ColorF2Yellow" Fail Fail Fail Fail
"ColorF3Blue" Fail Fail Fail Fail
"ColorF4Grey" Fail Fail Fail Fail
"ColorF5Brown" Fail Fail Fail Fail
"ClosedCaptionToggle" Fail Fail Fail Fail
"Dimmer" Fail Fail Fail Fail
"DisplaySwap" Fail Fail Fail Fail
"DVR" Fail Fail Fail Fail
"Exit" Fail Fail Fail Fail
"FavoriteClear0" Fail Fail Fail Fail
"FavoriteClear1" Fail Fail Fail Fail
"FavoriteClear2" Fail Fail Fail Fail
"FavoriteClear3" Fail Fail Fail Fail
"FavoriteRecall0" Fail Fail Fail Fail
"FavoriteRecall1" Fail Fail Fail Fail
"FavoriteRecall2" Fail Fail Fail Fail
"FavoriteRecall3" Fail Fail Fail Fail
"FavoriteStore0" Fail Fail Fail Fail
"FavoriteStore1" Fail Fail Fail Fail
"FavoriteStore2" Fail Fail Fail Fail
"FavoriteStore3" Fail Fail Fail Fail
"Guide" Fail Fail Fail Fail
"GuideNextDay" Fail Fail Fail Fail
"GuidePreviousDay" Fail Fail Fail Fail
"Info" Fail Fail Fail Fail
"InstantReplay" Fail Fail Fail Fail
"Link" Fail Fail Fail Fail
"ListProgram" Fail Fail Fail Fail
"LiveContent" Fail Fail Fail Fail
"Lock" Fail Fail Fail Fail
"MediaApps" Fail Fail Fail Fail
"MediaAudioTrack" Fail Fail Fail Fail
"MediaLast" Fail Fail Fail Fail
"MediaSkipBackward" Fail Fail Fail Fail
"MediaSkipForward" Fail Fail Fail Fail
"MediaStepBackward" Fail Fail Fail Fail
"MediaStepForward" Fail Fail Fail Fail
"MediaTopMenu" Fail Fail Fail Fail
"NavigateIn" Fail Fail Fail Fail
"NavigateNext" Fail Fail Fail Fail
"NavigateOut" Fail Fail Fail Fail
"NavigatePrevious" Fail Fail Fail Fail
"NextFavoriteChannel" Fail Fail Fail Fail
"NextUserProfile" Fail Fail Fail Fail
"OnDemand" Fail Fail Fail Fail
"Pairing" Fail Fail Fail Fail
"PinPDown" Fail Fail Fail Fail
"PinPMove" Fail Fail Fail Fail
"PinPToggle" Fail Fail Fail Fail
"PinPUp" Fail Fail Fail Fail
"PlaySpeedDown" Fail Fail Fail Fail
"PlaySpeedReset" Fail Fail Fail Fail
"PlaySpeedUp" Fail Fail Fail Fail
"RandomToggle" Fail Fail Fail Fail
"RcLowBattery" Fail Fail Fail Fail
"RecordSpeedNext" Fail Fail Fail Fail
"RfBypass" Fail Fail Fail Fail
"ScanChannelsToggle" Fail Fail Fail Fail
"ScreenModeNext" Fail Fail Fail Fail
"Settings" Fail Fail Fail Fail
"SplitScreenToggle" Fail Fail Fail Fail
"STBInput" Fail Fail Fail Fail
"STBPower" Fail Fail Fail Fail
"Subtitle" Fail Fail Fail Fail
"Teletext" Fail Fail Fail Fail
"VideoModeNext" Fail Fail Fail Fail
"Wink" Fail Fail Fail Fail
"ZoomToggle" Fail Fail Fail Fail

4. Acknowledgements

Special thanks to Masayuki Nakano (Mozilla) for his work gathering some of the implementation data that was used in this document - particularly those relating to IMEs and composition.

Conformance

Document conventions

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with class="example", like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with class="note", like this:

Note, this is an informative note.

Conformant Algorithms

Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should", "may", etc) used in introducing the algorithm.

Conformance requirements phrased as algorithms or specific steps can be implemented in any manner, so long as the end result is equivalent. In particular, the algorithms defined in this specification are intended to be easy to understand and are not intended to be performant. Implementers are encouraged to optimize.

Index

Terms defined by reference

References

Normative References

[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
[UIEvents]
Gary Kacmarcik; Travis Leithead. UI Events. URL: https://w3c.github.io/uievents/
[UIEvents-Code]
Gary Kacmarcik; Travis Leithead. UI Events KeyboardEvent code Values. URL: https://w3c.github.io/uievents-code/
[UIEvents-Key]
Gary Kacmarcik; Travis Leithead. UI Events KeyboardEvent key Values. URL: https://w3c.github.io/uievents-key/