New scheme for keyboard logical key ID (#85121)

This PR updates the ID used by logical keyboard keys.

The logical key ID is still composed of 2 parts: 32 bits of value, and 8 bits of plane. But the assignment of planes has been drastically changed. HID plane is removed, and unprintable plane and Flutter plane are added. This is to reflect the new generation method for logical key IDs. Now keys that are defined by Flutter but not by dom_key_data are placed into the Flutter plane, including numpad keys, sided modifier keys, and gamepad keys. The values for platform planes have also been adjusted.

The generation script and README have been updated accordingly as well.

A new file, test_utils/key_codes.h is now generated to assist engine unit testing.

All lists generated by the script are now sorted by the key.
This commit is contained in:
Tong Mu
2021-07-14 13:07:22 -07:00
committed by GitHub
parent 252f6a0285
commit c8d0b1d9db
38 changed files with 4814 additions and 4724 deletions

View File

@@ -9,7 +9,6 @@
| [`supplemental_hid_codes.inc`](supplemental_hid_codes.inc) | A supplementary HID list on top of Chromium's list of HID codes for extra physical keys. Certain entries may also overwrite Chromium's corresponding entries. |
| [`supplemental_key_data.inc`](supplemental_key_data.inc) | A supplementary key list on top of Chromium's list of keys for extra logical keys.|
| [`chromium_modifiers.json`](chromium_modifiers.json) | Maps the web's `key` for modifier keys to the names of the logical keys for these keys' left and right variations.This is used when generating logical keys to provide independent values for sided logical keys. Web uses the same `key` for modifier keys of different sides, but Flutter's logical key model treats them as different keys.|
| [`printable_to_numpads.json`](printable_to_numpads.json) | Maps a character to the names of the logical keys for these keys' number pad variations. This is used when generating logical keys to provide independent values for number pad logical keys. The web uses the character as the `key` for number pad keys, but Flutter's logical key model treats them as independent keys.|
| [`printable.json`](printable.json) | Maps Flutter key name to its printable character. This character is used as the key label.|
| [`synonyms.json`](synonyms.json) | Maps pseudo-keys that represent other keys to the sets of keys they represent. For example, this contains the "shift" key that represents either a "shiftLeft" or "shiftRight" key.|
@@ -58,7 +57,7 @@
| [`gtk_key_mapping_cc.tmpl`](gtk_key_mapping_cc.tmpl) | The template for `key_mapping.cc`. |
| [`gtk_lock_bit_mapping.json`](gtk_lock_bit_mapping.json) | Maps a name for GTK's modifier bit macro to Flutter's logical name (element #0) and physical name (element #1). This is used to generate checked keys that GTK should keep lock state synchronous on.|
| [`gtk_logical_name_mapping.json`](gtk_logical_name_mapping.json) | Maps a logical key name to the macro names of its corresponding `keyval`s. This is used to convert logical keys.|
| [`gtk_modifier_bit_mapping.json`](gtk_modifier_bit_mapping.json) | Maps a name for GTK's modifier bit macro to Flutter's logical name (element #0), physical name (element #1), and the physical name for the paired key (element #2). This is used to generate checked keys that GTK should keep pressing state synchronous on.|
| [`gtk_modifier_bit_mapping.json`](gtk_modifier_bit_mapping.json) | Maps a name for GTK's modifier bit macro to Flutter's physical name (element #0), logical name (element #1), and the logical name for the paired key (element #2). This is used to generate checked keys where GTK should keep the pressed state synchronized.|
| [`gtk_numpad_shift.json`](gtk_numpad_shift.json) | Maps the name of a `keyval` macro of a numpad key to that of the corresponding key with NumLock on. GTK uses different `keyval` for numpad keys with and without NumLock on, but Flutter's logical key model treats them as the same key.|
### Linux (GLFW)

View File

@@ -1,4 +1,5 @@
{
"Add": ["PLUS"],
"Again": ["AGAIN"],
"AltLeft": ["ALT_LEFT"],
"AltRight": ["ALT_RIGHT"],
@@ -7,6 +8,8 @@
"ArrowLeft": ["DPAD_LEFT"],
"ArrowRight": ["DPAD_RIGHT"],
"ArrowUp": ["DPAD_UP"],
"Asterisk": ["STAR"],
"At": ["AT"],
"AudioVolumeDown": ["VOLUME_DOWN"],
"AudioVolumeMute": ["VOLUME_MUTE"],
"AudioVolumeUp": ["VOLUME_UP"],
@@ -201,6 +204,7 @@
"None": ["UNKNOWN"],
"Notification": ["NOTIFICATION"],
"NumLock": ["NUM_LOCK"],
"NumberSign": ["POUND"],
"Numpad0": ["NUMPAD_0"],
"Numpad1": ["NUMPAD_1"],
"Numpad2": ["NUMPAD_2"],

View File

@@ -7,6 +7,8 @@
#include <glib.h>
#include <map>
#include "flutter/shell/platform/linux/fl_key_embedder_responder_private.h"
// DO NOT EDIT -- DO NOT EDIT -- DO NOT EDIT
// This file is generated by
// flutter/flutter@dev/tools/gen_keycodes/bin/gen_keycodes.dart and should not
@@ -15,14 +17,6 @@
// Edit the template dev/tools/gen_keycodes/data/gtk_key_mapping_cc.tmpl
// instead. See dev/tools/gen_keycodes/README.md for more information.
// Insert a new entry into a hashtable from uint64 to uint64.
//
// Returns whether the newly added value was already in the hash table or not.
static bool insert_record(GHashTable* table, guint64 xkb, guint64 fl_key) {
return g_hash_table_insert(table, uint64_to_gpointer(xkb),
uint64_to_gpointer(fl_key));
}
std::map<uint64_t, uint64_t> xkb_to_physical_key_map = {
@@@XKB_SCAN_CODE_MAP@@@
};
@@ -40,3 +34,5 @@ void initialize_lock_bit_to_checked_keys(GHashTable* table) {
FlKeyEmbedderCheckedKey* data;
@@@GTK_MODE_BIT_MAP@@@
}
@@@MASK_CONSTANTS@@@

View File

@@ -1,4 +1,4 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -36,4 +36,4 @@ const std::map<uint32_t, uint32_t> modifierFlagToKeyCode = {
@@@MODIFIER_FLAG_TO_KEYCODE_MAP@@@
};
@@@SPECIAL_KEY_CONSTANTS@@@
@@@SPECIAL_KEY_CONSTANTS@@@

View File

@@ -0,0 +1,40 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_COMMON_TESTING_KEY_CODES_H_
#define FLUTTER_SHELL_PLATFORM_COMMON_TESTING_KEY_CODES_H_
#include <cinttypes>
// DO NOT EDIT -- DO NOT EDIT -- DO NOT EDIT
// This file is generated by
// flutter/flutter:dev/tools/gen_keycodes/bin/gen_keycodes.dart and should not
// be edited directly.
//
// Edit the template
// flutter/flutter:dev/tools/gen_keycodes/data/key_codes_cc.tmpl
// instead.
//
// See flutter/flutter:dev/tools/gen_keycodes/README.md for more information.
// This file contains keyboard constants to be used in unit tests. They should
// not be used in production code.
namespace flutter {
namespace testing {
namespace keycodes {
@@@PHYSICAL_KEY_DEFINITIONS@@@
@@@LOGICAL_KEY_DEFINITIONS@@@
} // namespace keycodes
} // namespace testing
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_COMMON_TESTING_KEY_CODES_H_

View File

@@ -280,7 +280,7 @@ class LogicalKeyboardKey extends KeyboardKey {
/// would be 0x1020000ffff, but once Flutter added the "doWhatIMean" key to
/// the definitions below, the new code would be 0x0020000ffff for all
/// platforms that had a "do what I mean" key from then on.
bool get isAutogenerated => (keyId & autogeneratedMask) != 0;
bool get isAutogenerated => (keyId & planeMask) >= startOfPlatformPlanes;
/// Returns a set of pseudo-key synonyms for the given `key`.
///
@@ -323,45 +323,10 @@ class LogicalKeyboardKey extends KeyboardKey {
properties.add(StringProperty('debugName', debugName, showName: true, defaultValue: null));
}
/// Mask for the 32-bit value portion of the key code.
///
/// This is used by platform-specific code to generate Flutter key codes.
static const int valueMask = 0x000FFFFFFFF;
@@@MASK_CONSTANTS@@@
/// Mask for the platform prefix portion of the key code.
///
/// This is used by platform-specific code to generate Flutter key codes.
static const int platformMask = 0x0FF00000000;
/// Mask for the auto-generated bit portion of the key code.
///
/// This is used by platform-specific code to generate new Flutter key codes
/// for keys which are not recognized.
static const int autogeneratedMask = 0x10000000000;
/// Mask for the synonym pseudo-keys generated for keys which appear in more
/// than one place on the keyboard.
///
/// IDs in this range are used to represent keys which appear in multiple
/// places on the keyboard, such as the SHIFT, ALT, CTRL, and numeric keypad
/// keys. These key codes will never be generated by the key event system, but
/// may be used in key maps to represent the union of all the keys of each
/// type in order to match them.
///
/// To look up the synonyms that are defined, look in the [synonyms] map.
static const int synonymMask = 0x20000000000;
/// The code prefix for keys which have a Unicode representation.
///
/// This is used by platform-specific code to generate Flutter key codes.
static const int unicodePlane = 0x00000000000;
/// The code prefix for keys which do not have a Unicode representation.
///
/// This is used by platform-specific code to generate Flutter key codes using
/// HID Usage codes.
static const int hidPlane = 0x00100000000;
@@@LOGICAL_KEY_DEFINITIONS@@@
// A list of all predefined constant LogicalKeyboardKeys so they can be
// searched.
static const Map<int, LogicalKeyboardKey> _knownLogicalKeys = <int, LogicalKeyboardKey>{
@@ -373,7 +338,8 @@ class LogicalKeyboardKey extends KeyboardKey {
@@@LOGICAL_KEY_SYNONYMS@@@ };
static const Map<int, String> _keyLabels = <int, String>{
@@@LOGICAL_KEY_KEY_LABELS@@@ };
@@@LOGICAL_KEY_KEY_LABELS@@@
};
}
/// A class with static values that describe the keys that are returned from
@@ -520,7 +486,9 @@ class PhysicalKeyboardKey extends KeyboardKey {
// Key constants for all keyboard keys in the USB HID specification at the
// time Flutter was built.
@@@PHYSICAL_KEY_DEFINITIONS@@@
// A list of all the predefined constant PhysicalKeyboardKeys so that they
// can be searched.
static const Map<int, PhysicalKeyboardKey> _knownPhysicalKeys = <int, PhysicalKeyboardKey>{
@@ -530,5 +498,6 @@ class PhysicalKeyboardKey extends KeyboardKey {
static const Map<int, String> _debugNames = kReleaseMode ?
<int, String>{} :
<int, String>{
@@@PHYSICAL_KEY_DEBUG_NAMES@@@ };
@@@PHYSICAL_KEY_DEBUG_NAMES@@@
};
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,50 +0,0 @@
{
"valueMask": {
"value": "0x000FFFFFFFF",
"description": [
"Mask for the 32-bit value portion of the key code.",
"This is used by platform-specific code to generate Flutter key codes."
]
},
"platformMask": {
"value": "0x0FF00000000",
"description": [
"Mask for the platform prefix portion of the key code.",
"This is used by platform-specific code to generate Flutter key codes."
]
},
"unicodePlane": {
"value": "0x00000000000",
"description": [
"The code prefix for keys which have a Unicode representation.",
"This is used by platform-specific code to generate Flutter key codes."
]
},
"autogeneratedMask": {
"value": "0x10000000000",
"description": [
"Mask for the auto-generated bit portion of the key code.",
"This is used by platform-specific code to generate new Flutter key codes for keys which are not recognized."
]
},
"synonymMask": {
"value": "0x20000000000",
"description": [
"Mask for the synonym pseudo-keys generated for keys which appear in more than one place on the keyboard.",
"IDs in this range are used to represent keys which appear in multiple places on the keyboard, such as the SHIFT, ALT, CTRL, and numeric keypad keys. These key codes will never be generated by the key event system, but may be used in key maps to represent the union of all the keys of each type in order to match them.",
"To look up the synonyms that are defined, look in the [synonyms] map."
]
},
"hidPlane": {
"value": "0x00100000000",
"description": [
"The code prefix for keys which do not have a Unicode representation.",
"This is used by platform-specific code to generate Flutter key codes using HID Usage codes."
]
}
}

View File

@@ -1,12 +1,4 @@
{
"None": {
"names": {
"name": "None"
},
"scanCodes": {
"usb": 0
}
},
"Hyper": {
"names": {
"name": "Hyper",

View File

@@ -1,22 +0,0 @@
{
"0": "Numpad0",
"1": "Numpad1",
"2": "Numpad2",
"3": "Numpad3",
"4": "Numpad4",
"5": "Numpad5",
"6": "Numpad6",
"7": "Numpad7",
"8": "Numpad8",
"9": "Numpad9",
".": "NumpadDecimal",
"+": "NumpadAdd",
"-": "NumpadSubtract",
"*": "NumpadMultiply",
"/": "NumpadDivide",
"=": "NumpadEqual",
",": "NumpadComma",
"(": "NumpadParenLeft",
")": "NumpadParenRight",
"\u000D": "NumpadEnter"
}

View File

@@ -1,8 +1,8 @@
// These are supplemental key data to be added to those that Chromium
// defines.
// This file contains supplemental key data to be added to those that
// Chromium defines.
// ============================================================
// Printable keys
// Printable keys (Unicode plane)
// ============================================================
// Key Enum Unicode code point
@@ -76,63 +76,105 @@
DOM_KEY_UNI("Tilde", TILDE, '~'),
DOM_KEY_UNI("Bar", BAR, '|'),
// The following keys reside in the Flutter plane (0x0100000000).
// ============================================================
// Game controller buttons
// Miscellaneous (0x000__)
// ============================================================
// Since the web doesn't have game controller buttons defined in the
// same way, these map USB HID codes for game controller buttons to
// Android/Linux button names.
// Key Enum Value
DOM_KEY_MAP("GameButton1", GAME_BUTTON_1, 0x05ff01),
DOM_KEY_MAP("GameButton2", GAME_BUTTON_2, 0x05ff02),
DOM_KEY_MAP("GameButton3", GAME_BUTTON_3, 0x05ff03),
DOM_KEY_MAP("GameButton4", GAME_BUTTON_4, 0x05ff04),
DOM_KEY_MAP("GameButton5", GAME_BUTTON_5, 0x05ff05),
DOM_KEY_MAP("GameButton6", GAME_BUTTON_6, 0x05ff06),
DOM_KEY_MAP("GameButton7", GAME_BUTTON_7, 0x05ff07),
DOM_KEY_MAP("GameButton8", GAME_BUTTON_8, 0x05ff08),
DOM_KEY_MAP("GameButton9", GAME_BUTTON_9, 0x05ff09),
DOM_KEY_MAP("GameButton10", GAME_BUTTON_10, 0x05ff0a),
DOM_KEY_MAP("GameButton11", GAME_BUTTON_11, 0x05ff0b),
DOM_KEY_MAP("GameButton12", GAME_BUTTON_12, 0x05ff0c),
DOM_KEY_MAP("GameButton13", GAME_BUTTON_13, 0x05ff0d),
DOM_KEY_MAP("GameButton14", GAME_BUTTON_14, 0x05ff0e),
DOM_KEY_MAP("GameButton15", GAME_BUTTON_15, 0x05ff0f),
DOM_KEY_MAP("GameButton16", GAME_BUTTON_16, 0x05ff10),
DOM_KEY_MAP("GameButtonA", GAME_BUTTON_A, 0x05ff11),
DOM_KEY_MAP("GameButtonB", GAME_BUTTON_B, 0x05ff12),
DOM_KEY_MAP("GameButtonC", GAME_BUTTON_C, 0x05ff13),
DOM_KEY_MAP("GameButtonLeft1", GAME_BUTTON_L1, 0x05ff14),
DOM_KEY_MAP("GameButtonLeft2", GAME_BUTTON_L2, 0x05ff15),
DOM_KEY_MAP("GameButtonMode", GAME_BUTTON_MODE, 0x05ff16),
DOM_KEY_MAP("GameButtonRight1", GAME_BUTTON_R1, 0x05ff17),
DOM_KEY_MAP("GameButtonRight2", GAME_BUTTON_R2, 0x05ff18),
DOM_KEY_MAP("GameButtonSelect", GAME_BUTTON_SELECT, 0x05ff19),
DOM_KEY_MAP("GameButtonStart", GAME_BUTTON_START, 0x05ff1a),
DOM_KEY_MAP("GameButtonThumbLeft", GAME_BUTTON_THUMBL, 0x05ff1b),
DOM_KEY_MAP("GameButtonThumbRight", GAME_BUTTON_THUMBR, 0x05ff1c),
DOM_KEY_MAP("GameButtonX", GAME_BUTTON_X, 0x05ff1d),
DOM_KEY_MAP("GameButtonY", GAME_BUTTON_Y, 0x05ff1e),
DOM_KEY_MAP("GameButtonZ", GAME_BUTTON_Z, 0x05ff1f),
// Key Enum Value
FLUTTER_KEY_MAP("Suspend", SUSPEND, 0x00000),
FLUTTER_KEY_MAP("Resume", RESUME, 0x00001),
FLUTTER_KEY_MAP("Sleep", SLEEP, 0x00002),
FLUTTER_KEY_MAP("Abort", ABORT, 0x00003),
FLUTTER_KEY_MAP("Lang1", LANG1, 0x00010),
FLUTTER_KEY_MAP("Lang2", LANG2, 0x00011),
FLUTTER_KEY_MAP("Lang3", LANG3, 0x00012),
FLUTTER_KEY_MAP("Lang4", LANG4, 0x00013),
FLUTTER_KEY_MAP("Lang5", LANG5, 0x00014),
FLUTTER_KEY_MAP("IntlBackslash", INTL_BACKSLASH, 0x00020),
FLUTTER_KEY_MAP("IntlRo", INTL_RO, 0x00021),
FLUTTER_KEY_MAP("IntlYen", INTL_YEN, 0x00022),
// ============================================================
// Other buttons
// Modifiers (0x001__)
// ============================================================
// Key Enum Value
FLUTTER_KEY_MAP("ControlLeft", CONTROL_LEFT, 0x00100),
FLUTTER_KEY_MAP("ControlRight", CONTROL_RIGHT, 0x00101),
FLUTTER_KEY_MAP("ShiftLeft", SHIFT_LEFT, 0x00102),
FLUTTER_KEY_MAP("ShiftRight", SHIFT_RIGHT, 0x00103),
FLUTTER_KEY_MAP("AltLeft", ALT_LEFT, 0x00104),
FLUTTER_KEY_MAP("AltRight", ALT_RIGHT, 0x00105),
FLUTTER_KEY_MAP("MetaLeft", META_LEFT, 0x00106),
FLUTTER_KEY_MAP("MetaRight", META_RIGHT, 0x00107),
// Synonym keys are added for compatibility and will be removed in the future.
FLUTTER_KEY_MAP("Control", CONTROL, 0x001F0),
FLUTTER_KEY_MAP("Shift", SHIFT, 0x001F2),
FLUTTER_KEY_MAP("Alt", ALT, 0x001F4),
FLUTTER_KEY_MAP("Meta", META, 0x001F6),
// ============================================================
// Number pad (0x002__)
// ============================================================
// The value for number pad buttons are derived from their unicode code
// points.
FLUTTER_KEY_MAP("NumpadEnter", NUMPAD_ENTER, 0x0020D),
FLUTTER_KEY_MAP("NumpadParenLeft", NUMPAD_PAREN_LEFT, 0x00228),
FLUTTER_KEY_MAP("NumpadParenRight", NUMPAD_PAREN_RIGHT, 0x00229),
FLUTTER_KEY_MAP("NumpadMultiply", NUMPAD_MULTIPLY, 0x0022A),
FLUTTER_KEY_MAP("NumpadAdd", NUMPAD_ADD, 0x0022B),
FLUTTER_KEY_MAP("NumpadComma", NUMPAD_COMMA, 0x0022C),
FLUTTER_KEY_MAP("NumpadSubtract", NUMPAD_SUBTRACT, 0x0022D),
FLUTTER_KEY_MAP("NumpadDecimal", NUMPAD_DECIMAL, 0x0022E),
FLUTTER_KEY_MAP("NumpadDivide", NUMPAD_DIVIDE, 0x0022F),
FLUTTER_KEY_MAP("Numpad0", NUMPAD_0, 0x00230),
FLUTTER_KEY_MAP("Numpad1", NUMPAD_1, 0x00231),
FLUTTER_KEY_MAP("Numpad2", NUMPAD_2, 0x00232),
FLUTTER_KEY_MAP("Numpad3", NUMPAD_3, 0x00233),
FLUTTER_KEY_MAP("Numpad4", NUMPAD_4, 0x00234),
FLUTTER_KEY_MAP("Numpad5", NUMPAD_5, 0x00235),
FLUTTER_KEY_MAP("Numpad6", NUMPAD_6, 0x00236),
FLUTTER_KEY_MAP("Numpad7", NUMPAD_7, 0x00237),
FLUTTER_KEY_MAP("Numpad8", NUMPAD_8, 0x00238),
FLUTTER_KEY_MAP("Numpad9", NUMPAD_9, 0x00239),
FLUTTER_KEY_MAP("NumpadEqual", NUMPAD_EQUAL, 0x0023D),
// ============================================================
// Game controller buttons (0x003__)
// ============================================================
// Key Enum Value
DOM_KEY_MAP("None", NONE, 0x0),
DOM_KEY_MAP("Suspend", SUSPEND, 0x100000014),
DOM_KEY_MAP("Resume", RESUME, 0x100000015),
DOM_KEY_MAP("Sleep", SLEEP, 0x100010082),
DOM_KEY_MAP("IntlBackslash", INTL_BACKSLASH, 0x100070064),
DOM_KEY_MAP("IntlRo", INTL_RO, 0x100070087),
DOM_KEY_MAP("IntlYen", INTL_YEN, 0x100070089),
DOM_KEY_MAP("Lang1", LANG1, 0x100070090),
DOM_KEY_MAP("Lang2", LANG2, 0x100070091),
DOM_KEY_MAP("Lang3", LANG3, 0x100070092),
DOM_KEY_MAP("Lang4", LANG4, 0x100070093),
DOM_KEY_MAP("Lang5", LANG5, 0x100070094),
DOM_KEY_MAP("Abort", ABORT, 0x10007009b),
// The value for game controller buttons are derived from the last 8 bit
// of its USB HID usage.
// Key Enum Value
FLUTTER_KEY_MAP("GameButton1", GAME_BUTTON_1, 0x00301),
FLUTTER_KEY_MAP("GameButton2", GAME_BUTTON_2, 0x00302),
FLUTTER_KEY_MAP("GameButton3", GAME_BUTTON_3, 0x00303),
FLUTTER_KEY_MAP("GameButton4", GAME_BUTTON_4, 0x00304),
FLUTTER_KEY_MAP("GameButton5", GAME_BUTTON_5, 0x00305),
FLUTTER_KEY_MAP("GameButton6", GAME_BUTTON_6, 0x00306),
FLUTTER_KEY_MAP("GameButton7", GAME_BUTTON_7, 0x00307),
FLUTTER_KEY_MAP("GameButton8", GAME_BUTTON_8, 0x00308),
FLUTTER_KEY_MAP("GameButton9", GAME_BUTTON_9, 0x00309),
FLUTTER_KEY_MAP("GameButton10", GAME_BUTTON_10, 0x0030a),
FLUTTER_KEY_MAP("GameButton11", GAME_BUTTON_11, 0x0030b),
FLUTTER_KEY_MAP("GameButton12", GAME_BUTTON_12, 0x0030c),
FLUTTER_KEY_MAP("GameButton13", GAME_BUTTON_13, 0x0030d),
FLUTTER_KEY_MAP("GameButton14", GAME_BUTTON_14, 0x0030e),
FLUTTER_KEY_MAP("GameButton15", GAME_BUTTON_15, 0x0030f),
FLUTTER_KEY_MAP("GameButton16", GAME_BUTTON_16, 0x00310),
FLUTTER_KEY_MAP("GameButtonA", GAME_BUTTON_A, 0x00311),
FLUTTER_KEY_MAP("GameButtonB", GAME_BUTTON_B, 0x00312),
FLUTTER_KEY_MAP("GameButtonC", GAME_BUTTON_C, 0x00313),
FLUTTER_KEY_MAP("GameButtonLeft1", GAME_BUTTON_L1, 0x00314),
FLUTTER_KEY_MAP("GameButtonLeft2", GAME_BUTTON_L2, 0x00315),
FLUTTER_KEY_MAP("GameButtonMode", GAME_BUTTON_MODE, 0x00316),
FLUTTER_KEY_MAP("GameButtonRight1", GAME_BUTTON_R1, 0x00317),
FLUTTER_KEY_MAP("GameButtonRight2", GAME_BUTTON_R2, 0x00318),
FLUTTER_KEY_MAP("GameButtonSelect", GAME_BUTTON_SELECT, 0x00319),
FLUTTER_KEY_MAP("GameButtonStart", GAME_BUTTON_START, 0x0031a),
FLUTTER_KEY_MAP("GameButtonThumbLeft", GAME_BUTTON_THUMBL, 0x0031b),
FLUTTER_KEY_MAP("GameButtonThumbRight", GAME_BUTTON_THUMBR, 0x0031c),
FLUTTER_KEY_MAP("GameButtonX", GAME_BUTTON_X, 0x0031d),
FLUTTER_KEY_MAP("GameButtonY", GAME_BUTTON_Y, 0x0031e),
FLUTTER_KEY_MAP("GameButtonZ", GAME_BUTTON_Z, 0x0031f),

View File

@@ -9,7 +9,7 @@
// Edit the template dev/tools/gen_keycodes/data/web_key_map_dart.tmpl instead.
// See dev/tools/gen_keycodes/README.md for more information.
/// Maps Web KeyboardEvent codes to the matching LogicalKeyboardKey id.
/// Maps Web KeyboardEvent keys to the matching LogicalKeyboardKey id.
const Map<String, int> kWebToLogicalKey = <String, int>{
@@@WEB_LOGICAL_KEY_CODE_MAP@@@
};

View File

@@ -37,6 +37,8 @@ std::map<uint64_t, uint64_t> KeyboardKeyEmbedderHandler::scanCodeToLogicalMap_ =
@@@WINDOWS_SCAN_CODE_TO_LOGICAL_MAP@@@
};
@@@MASK_CONSTANTS@@@
} // namespace flutter
#endif

View File

@@ -10,8 +10,7 @@
"Lang1": ["HANGUL", "HANGEUL", "KANA"],
"JunjaMode": ["JUNJA"],
"FinalMode": ["FINAL"],
"HanjaMode": ["HANJA"],
"KanjiMode": ["KANJI"],
"KanjiMode": ["KANJI", "HANJA"],
"Escape": ["ESCAPE"],
"Convert": ["CONVERT"],
"Nonconvert": ["NONCONVERT"],
@@ -49,7 +48,7 @@
"Numpad9": ["NUMPAD9"],
"NumpadMultiply": ["MULTIPLY"],
"NumpadAdd": ["ADD"],
"NumpadSeparator": ["SEPARATOR"],
"NumpadComma": ["SEPARATOR"],
"NumpadSubtract": ["SUBTRACT"],
"NumpadDecimal": ["DECIMAL"],
"NumpadDivide": ["DIVIDE"],