flutter/dev/tools/gen_keycodes/data
Greg Spencer 6b087c74e2
Add iOS key map generation, make macOS var naming consistent with repo (#83146)
This adds iOS key map generation that uses std::maps. It uses std::maps because on iOS if we use NSDictionaries, then when XCode loads the dylib, the initialization of those status NSDictionaries hasn't yet occurred, and it crashes the app. std::maps have a well-defined static behavior, and are correctly initialized.

I also made the naming of variables, fields, etc. consistent for macOS. We variously had macosFoo, macOSFoo, and macOsFoo. I eliminated macOsFoo and macosFoo, since the rest of the repo uses macOSFoo for lowerCamelCase names (with only a few exceptions). I used iOSFoo for iOS.
2021-05-25 17:18:06 -07:00
..
android_key_name_to_name.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
android_keyboard_map_java.tmpl Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
chromium_modifiers.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
fuchsia_keyboard_map_cc.tmpl Add iOS key map generation, make macOS var naming consistent with repo (#83146) 2021-05-25 17:18:06 -07:00
glfw_key_name_to_name.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
glfw_keyboard_map_cc.tmpl Add iOS key map generation, make macOS var naming consistent with repo (#83146) 2021-05-25 17:18:06 -07:00
gtk_key_mapping_cc.tmpl Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
gtk_lock_bit_mapping.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
gtk_logical_name_mapping.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
gtk_modifier_bit_mapping.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
gtk_numpad_shift.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
ios_key_code_map_cc.tmpl Add iOS key map generation, make macOS var naming consistent with repo (#83146) 2021-05-25 17:18:06 -07:00
ios_keyboard_map_cc.tmpl Add iOS key map generation, make macOS var naming consistent with repo (#83146) 2021-05-25 17:18:06 -07:00
ios_logical_to_physical.json Add Enter and Tab back in to ios and macos key maps (#81865) 2021-05-11 10:23:11 -07:00
keyboard_key.tmpl Fix typos (#82589) 2021-05-20 17:19:09 -07:00
keyboard_maps.tmpl Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
logical_key_data.json Add iOS key map generation, make macOS var naming consistent with repo (#83146) 2021-05-25 17:18:06 -07:00
macos_key_code_map_cc.tmpl Add iOS key map generation, make macOS var naming consistent with repo (#83146) 2021-05-25 17:18:06 -07:00
macos_logical_to_physical.json Add Enter and Tab back in to ios and macos key maps (#81865) 2021-05-11 10:23:11 -07:00
mask_constants.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
physical_key_data.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
printable_to_numpads.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
printable.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
README.md Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
supplemental_hid_codes.inc Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
supplemental_key_data.inc Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
synonyms.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
web_key_map_dart.tmpl [key_codegen] Remove webValues (#81678) 2021-05-10 03:16:25 -07:00
web_logical_location_mapping.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
windows_flutter_key_map_cc.tmpl Add iOS key map generation, make macOS var naming consistent with repo (#83146) 2021-05-25 17:18:06 -07:00
windows_logical_to_window_vk.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00
windows_scancode_logical_map.json Hardware keyboard: codegen (#73440) 2021-04-30 21:06:03 -07:00

Files

General

File name Explanation
physical_key_data.json Contains the merged physical key data from all the other sources. This file is regenerated if "--collect" is specified for the gen_keycodes script, or used as a source otherwise.
logical_key_data.json Contains the merged logical key data from all the other sources. This file is regenerated if "--collect" is specified for the gen_keycodes script, or used as a source otherwise.
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 A supplementary key list on top of Chromium's list of keys for extra logical keys.
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 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 Maps Flutter key name to its printable character. This character is used as the key label.
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.

Framework

File name Explanation
keyboard_key.tmpl The template for keyboard_key.dart.
keyboard_maps.tmpl The template for keyboard_maps.dart.

Android

File name Explanation
android_keyboard_map_java.tmpl The template for KeyboardMap.java.
android_key_name_to_name.json Maps a logical key name to the names of its corresponding keycode constants. This is used to convert logical keys.

iOS

File name Explanation
ios_logical_to_physical.json Maps a logical key name to the names of its corresponding physical keys. This is used to derive logical keys (from keyCode) that can't or shouldn't be derived from characterIgnoringModifiers.
ios_keyboard_map_cc.tmpl The template for keyboard_map.cc. (Unused for now.)

Web

File name Explanation
web_key_map_dart.tmpl The template for key_map.dart.
web_logical_location_mapping.json Maps a pair of the web's key and location to the name for its corresponding logical key. This is used to distinguish between logical keys with the same key but different locations.

Windows

File name Explanation
windows_flutter_key_map_cc.tmpl The template for flutter_key_map.cc.
windows_logical_to_window_vk.json Maps a logical key name to the names of its corresponding virtual keys in Win32.
windows_scancode_logical_map.json Maps a physical key name to a logical key name. This is used to when a keycode maps to multiple keys (including when the keycode is 0), therefore can only be told apart by the scan code.

Linux (GTK)

File name Explanation
gtk_key_mapping_cc.tmpl The template for key_mapping.cc.
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 Maps a logical key name to the macro names of its corresponding keyvals. This is used to convert logical keys.
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_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)

File name Explanation
glfw_key_name_to_name.json Maps a logical key name to the names of its GLFW macro. (Unused for now.)
glfw_keyboard_map_cc.tmpl The template for keyboard_map.cc. (Unused for now.)

macOS

File name Explanation
macos_key_code_map_cc.tmpl The template for KeyCodeMap.cc.
macos_logical_to_physical.json Maps a logical key name to the names of its corresponding physical keys. This is used to derive logical keys (from keyCode) that can't or shouldn't be derived from characterIgnoringModifiers.

Fuchsia

File name Explanation
fuchsia_keyboard_map_cc.tmpl The template for keyboard_map.cc. (Unused for now.)