[Keyboard, Web] Map from "Esc" to the Escape key (#106133)

* Impl

* Fix build

* Add test
This commit is contained in:
Tong Mu
2022-06-21 13:27:12 -07:00
committed by GitHub
parent df55dbb9d9
commit 0ac05f1c5c
13 changed files with 125 additions and 51 deletions

View File

@@ -1552,7 +1552,8 @@
"value": 4294967323,
"names": {
"web": [
"Escape"
"Escape",
"Esc"
],
"macos": [
"Escape"

View File

@@ -1192,6 +1192,9 @@
"name": "Escape",
"chromium": "Escape"
},
"otherWebCodes": [
"Esc"
],
"scanCodes": {
"android": [
1

View File

@@ -50,6 +50,11 @@
DOM_CODE(0x05ff1e, 0x0000, 0x0000, 0x0000, 0xffff, "GameButtonY", BUTTON_Y),
DOM_CODE(0x05ff1f, 0x0000, 0x0000, 0x0000, 0xffff, "GameButtonZ", BUTTON_Z),
// Sometimes the Escape key produces "Esc" instead of "Escape". This includes
// older IE and Firefox browsers, and the current Cobalt browser.
// See: https://github.com/flutter/flutter/issues/106062
DOM_CODE(0x070029, 0x0000, 0x0000, 0x0000, 0xffff, "Esc", ESCAPE),
// ============================================================
// Fn key for Mac
// ============================================================
@@ -58,4 +63,4 @@
// defined on other platforms. Chromium does define an "Fn" row, but doesn't
// give it a Mac keycode. This overrides their definition.
// USB HID evdev XKB Win Mac DOMKey Code
DOM_CODE(0x000012, 0x0000, 0x0000, 0x0000, 0x003f, "Fn", FN),
DOM_CODE(0x000012, 0x0000, 0x0000, 0x0000, 0x003f, "Fn", FN),

View File

@@ -76,6 +76,16 @@
DOM_KEY_UNI("Tilde", TILDE, '~'),
DOM_KEY_UNI("Bar", BAR, '|'),
// ============================================================
// Unprintable keys (Unicode plane)
// ============================================================
// Key Enum Value
// Sometimes the Escape key produces "Esc" instead of "Escape". This includes
// older IE and Firefox browsers, and the current Cobalt browser.
// See: https://github.com/flutter/flutter/issues/106062
DOM_KEY_MAP("Esc", ESC, 0x1B),
// The following keys reside in the Flutter plane (0x0100000000).
// ============================================================