1. Introduction
The [UIEvents-Code] specification defines the set of values that are valid for use
in the code
attribute.
This document summarizes the current implementation status of the code
attribute and its values.
The following versions of each user agents were tested:
-
Google Chrome 60.0.3112.113 (Windows 10, OS X 10.12.2, Ubuntu)
-
Mozilla Firefox 55.0 (Windows 10, OS X 10.12.2, Ubuntu)
-
Microsoft Edge 83.0.478.58 (Windows 10)
-
Apple Safari 13.1.1 (OS X 10.14.6)
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.
Manual tests were performed by visiting the domeeventviewer.com/key-event-viewer.html test page and examining the "code" column after pressing the key being tested. To test keys (like "IntlBackslash") that are only present on keyboards for certain locales, this requires using a keyboard 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 112 required values of the code
attribute Pass in at least 2 independent implementations.
The Candidate Recommendation exit criteria are therefore fulfilled.
In addition, the specification describes 60 optional values that may be used to support multimedia or legacy keyboards. Of these, manual tests confirm that 9 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).
Entries marked with "N/A" are not currently testable, typically because the devices with that key do not generate separate keyboard events. E.g., FnLock.
3.2.1. code
Attribute
The code
attribute (defined in [UIEvents]) is present in all
browsers tested.
KeyboardEvent attribute
| Windows | macOS | Linux | Notes | |||||
---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Edge | Chrome | Firefox | Safari | Chrome | Firefox | ||
code
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass |
3.2.2. Required code
Values
This section lists the test results for the basic set of code
attribute values that a conforming implementation must support.
code attribute value | Windows | macOS | Linux | Notes | |||||
---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Edge | Chrome | Firefox | Safari | Chrome | Firefox | ||
Alphanumeric Section - Writing System Keys | |||||||||
"Backquote"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Backslash"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"BracketLeft"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"BracketRight"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Comma"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit0"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit1"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit2"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit3"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit4"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit5"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit6"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit7"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit8"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Digit9"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Equal"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"IntlBackslash"
| Pass | Pass | Pass | Pass | Pass | Fail | Pass | Pass | Safari swaps IntlBackslash with Backquote on keyboards that support IntlBackslash |
"IntlRo"
| Pass | Pass | Pass | ? | ? | ? | ? | ? | |
"IntlYen"
| Pass | Pass | Pass | ? | ? | ? | ? | ? | |
"KeyA"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyB"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyC"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyD"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyE"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyF"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyG"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyH"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyI"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyJ"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyK"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyL"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyM"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyN"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyO"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyP"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyQ"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyR"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyS"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyT"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyU"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyV"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyW"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyX"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyY"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"KeyZ"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Minus"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Period"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Quote"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Semicolon"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Slash"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
Alphanumeric Section - Functional Keys | |||||||||
"AltLeft"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"AltRight"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Backspace"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"CapsLock"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"ContextMenu"
| Pass | Pass | Pass | Pass | Pass | Fail | Pass | Pass | Safari returns "Unidentified" |
"ControlLeft"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"ControlRight"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Enter"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"MetaLeft"
| Pass | Fail | Pass | Pass | Fail | Pass | Pass | Fail | Firefox returns "OSLeft" |
"MetaRight"
| Pass | Fail | Pass | Pass | Fail | Pass | Pass | Fail | Firefox returns "OSRight" |
"ShiftLeft"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"ShiftRight"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Space"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Tab"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Convert"
| Pass | Pass | Pass | ? | ? | ? | ? | ? | |
"KanaMode"
| Pass | Pass | Pass | ? | ? | ? | ? | ? | |
"NonConvert"
| Pass | Pass | Pass | ? | ? | ? | ? | ? | |
Control Pad Section | |||||||||
"Delete"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"End"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Home"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"Insert"
| Pass | Pass | Pass | Pass | Pass | Fail | Pass | Pass | Safari returns "Help" |
"PageDown"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"PageUp"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
Arrow Pad Section | |||||||||
"ArrowDown"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"ArrowLeft"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"ArrowRight"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"ArrowUp"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
Numpad Section | |||||||||
"NumLock"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad0"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad1"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad2"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad3"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad4"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad5"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad6"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad7"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad8"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"Numpad9"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"NumpadAdd"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"NumpadDecimal"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"NumpadDivide"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"NumpadEnter"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"NumpadMultiply"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
"NumpadSubtract"
| Pass | ? | Pass | Pass | Pass | Pass | Pass | Pass | |
Function Section | |||||||||
"Escape"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F1"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F2"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F3"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F4"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F5"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F6"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F7"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F8"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F9"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F10"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass | |
"F11"
| Pass | Pass | Pass | Pass | ? | ? | Pass | ? | macOS & Ubuntu enter fullscreen; Chrome requires KeyboardLock |
"F12"
| Pass | Pass | Pass | Pass | Pass | Pass | ? | ? | |
"PrintScreen"
| Pass | Pass | Pass | Fail | Fail | Fail | ? | ? | macOS returns "F13"; Ubuntu takes screenshot |
"ScrollLock"
| Pass | Pass | Pass | ? | ? | ? | Pass | Pass | macOS decreases brightness |
"Pause"
| Pass | Pass | Pass | ? | ? | ? | Pass | Pass | macOS increases brightness |
Special Values | |||||||||
"Unidentified"
| Pass | Pass | Pass | Pass | Pass | Pass | Pass | Pass |
3.2.3. Optional code
Values
This section lists the test results for the set of code
attribute values that a conforming implementation may use to support special
keyboards (such as multimedia or legacy keyboards).
code attribute value | Windows | macOS | Linux | Notes | |||||
---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Edge | Chrome | Firefox | Safari | Chrome | Firefox | ||
Media Keys | |||||||||
"BrowserBack"
| Pass | Pass | Pass | Fail | Fail | Fail | Pass | ? | Handled by OS (Chrome requires KeyboardLock) |
"BrowserFavorites"
| Pass | Pass | Pass | Fail | Fail | Fail | Pass | ? | Handled by OS (Chrome requires KeyboardLock) |
"BrowserForward"
| Pass | Pass | Pass | Fail | Fail | Fail | Pass | ? | Handled by OS (Chrome requires KeyboardLock) |
"BrowserHome"
| Pass | ? | Pass | Fail | Fail | Fail | Pass | ? | Handled by OS (Chrome requires KeyboardLock) |
"BrowserRefresh"
| ? | ? | Fail | ? | ? | ? | ? | ? | |
"BrowserSearch"
| Fail | ? | Fail | Fail | Fail | Fail | Fail | Fail | |
"BrowserStop"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Eject"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"LaunchApp1"
| ? | ? | ? | Fail | Fail | Fail | ? | ? | |
"LaunchApp2"
| ? | ? | ? | Fail | Fail | Fail | ? | ? | |
"LaunchMail"
| N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | Handled by OS |
"MediaPlayPause"
| N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | Handled by OS |
"MediaSelect"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"MediaStop"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"MediaTrackNext"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"MediaTrackPrevious"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Power"
| ? | ? | ? | Fail | ? | ? | ? | ? | |
"Sleep"
| ? | ? | ? | Fail | ? | ? | ? | ? | |
"AudioVolumeDown"
| N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | Handled by OS |
"AudioVolumeMute"
| N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | Handled by OS |
"AudioVolumeUp"
| N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | Handled by OS |
"WakeUp"
| ? | ? | ? | Fail | ? | ? | ? | ? | |
Alphanumeric Section - Functional Keys | |||||||||
"Lang1"
| ? | ? | ? | Fail | Pass | Fail | Pass | Pass | Safari returns KanaMode |
"Lang2"
| ? | ? | ? | Fail | Pass | Pass | Pass | Pass | |
"Lang3"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Lang4"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Lang5"
| ? | ? | ? | ? | ? | ? | ? | ? | |
Numpad Section | |||||||||
"NumpadBackspace"
| Fail | Fail | Fail | Fail | ? | ? | Fail | Fail | Chrome/Firefox/Safari return "Backspace" |
"NumpadClear"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"NumpadClearEntry"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"NumpadComma"
| ? | ? | ? | ? | ? | ? | ? | ? | Need to test with Brazilian keyboard. |
"NumpadEqual"
| Pass | ? | Pass | Pass | ? | ? | Pass | Pass | |
"NumpadHash"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"NumpadMemoryAdd"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"NumpadMemoryClear"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"NumpadMemoryRecall"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"NumpadMemoryStore"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"NumpadMemorySubtract"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"NumpadParenLeft"
| Pass | ? | ? | Fail | ? | ? | Pass | Pass | |
"NumpadParenRight"
| Pass | ? | ? | Fail | ? | ? | Pass | Pass | |
"NumpadStar"
| ? | ? | ? | ? | ? | ? | ? | ? | |
Function Section | |||||||||
"Fn"
| N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | |
"FnLock"
| N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | |
Legacy, Non-Standard and Special Keys | |||||||||
"Hyper"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Super"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Turbo"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Abort"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Resume"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Suspend"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Again"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Copy"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Cut"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Find"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Open"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Paste"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Props"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Select"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Undo"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Hiragana"
| ? | ? | ? | ? | ? | ? | ? | ? | |
"Katakana"
| ? | ? | ? | ? | ? | ? | ? | ? |