Hardware keyboard: codegen (#73440)
Rewrites tools/gen_keycodes, the script that generates key mappings across the framework and the engine.
This commit is contained in:
@@ -59,6 +59,16 @@ const Map<int, LogicalKeyboardKey> kMacOsFunctionKeyMap = <int, LogicalKeyboardK
|
||||
@@@MACOS_FUNCTION_KEY_MAP@@@
|
||||
};
|
||||
|
||||
/// A map of macOS key codes presenting [LogicalKeyboardKey].
|
||||
///
|
||||
/// Logical key codes are not available in macOS key events. Most of the logical keys
|
||||
/// are derived from its `characterIgnoringModifiers`, but those keys that don't
|
||||
/// have a character representation will be derived from their key codes using
|
||||
/// this map.
|
||||
const Map<int, LogicalKeyboardKey> kMacOsToLogicalKey = <int, LogicalKeyboardKey>{
|
||||
@@@MACOS_KEY_CODE_MAP@@@
|
||||
};
|
||||
|
||||
/// Maps iOS-specific key code values representing [PhysicalKeyboardKey].
|
||||
///
|
||||
/// iOS doesn't provide a scan code, but a virtual keycode to represent a physical key.
|
||||
@@ -73,6 +83,16 @@ const Map<int, LogicalKeyboardKey> kIosNumPadMap = <int, LogicalKeyboardKey>{
|
||||
@@@IOS_NUMPAD_MAP@@@
|
||||
};
|
||||
|
||||
/// A map of iOS key codes presenting [LogicalKeyboardKey].
|
||||
///
|
||||
/// Logical key codes are not available in iOS key events. Most of the logical keys
|
||||
/// are derived from its `characterIgnoringModifiers`, but those keys that don't
|
||||
/// have a character representation will be derived from their key codes using
|
||||
/// this map.
|
||||
const Map<int, LogicalKeyboardKey> kIosToLogicalKey = <int, LogicalKeyboardKey>{
|
||||
@@@IOS_KEY_CODE_MAP@@@
|
||||
};
|
||||
|
||||
/// Maps GLFW-specific key codes to the matching [LogicalKeyboardKey].
|
||||
const Map<int, LogicalKeyboardKey> kGlfwToLogicalKey = <int, LogicalKeyboardKey>{
|
||||
@@@GLFW_KEY_CODE_MAP@@@
|
||||
@@ -119,6 +139,13 @@ const Map<String, LogicalKeyboardKey> kWebNumPadMap = <String, LogicalKeyboardKe
|
||||
@@@WEB_NUMPAD_MAP@@@
|
||||
};
|
||||
|
||||
/// A map of Web KeyboardEvent keys which needs to be decided based on location,
|
||||
/// typically for numpad kyes and modifier keys. Used to provide different key
|
||||
/// objects for keys like KEY_EQUALS and NUMPAD_EQUALS.
|
||||
const Map<String, List<LogicalKeyboardKey?>> kWebLocationMap = <String, List<LogicalKeyboardKey?>>{
|
||||
@@@WEB_LOCATION_MAP@@@
|
||||
};
|
||||
|
||||
/// Maps Windows KeyboardEvent codes to the matching [LogicalKeyboardKey].
|
||||
const Map<int, LogicalKeyboardKey> kWindowsToLogicalKey = <int, LogicalKeyboardKey>{
|
||||
@@@WINDOWS_LOGICAL_KEY_MAP@@@
|
||||
|
||||
Reference in New Issue
Block a user