1. Change chromium default branch from master (404) to main.
2. When I migrated the template to ARC is triggered a `-Wobjc-redundant-literal-use` error, so fix that. Engine PR is https://github.com/flutter/engine/pull/51981
3. Update to `FLUTTER_SHELL_PLATFORM_EMBEDDER_TEST_UTILS_KEY_CODES_G_H_` to match https://github.com/flutter/engine/pull/49006
This only updates the template and the script--I ran the script to validate it worked and built in the engine, but did not check in the actual generated key code changes (filed https://github.com/flutter/flutter/issues/146480 for that).
The generated file is a `.cc` file that does not need header guards. This change updates the template that's used to generate that `.cc` file.
No tests as this is a refactoring with no semantic changes.
The generated `.cc` file in the engine will be updated by https://github.com/flutter/engine/pull/48993
## Description
This cleans up how synonyms are calculated, and adds a reverse mapping from pseudo keys to the real keys they are synonyms of.
Updates the `layout_goals.json` to include the "Space" key, since that was added in the engine without updating the generation configuration.
The (new, not yet used) code gen for iOS was setting up a std::map from key codes to logical and physical key codes, but it was using uint32_t, which isn't big enough to hold the Flutter key codes.
Also, iOS needs to be able to filter out function keys, so I added a function key set.
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 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.
I noticed that tab traversal stopped working on iOS when #73440 was landed.
It seems to be that the control characters were excluded from the list of logical keys, and so they ended up being generated values.
This PR just adds "Enter" and "Tab" to the list for both macOS and iOS.
This fixes a problem where the character field of the RawKeyEvent was not being set at all for non-Android platforms.
I also updated the key maps, and corrected a problem with the Windows key map where the backquote character wasn't correctly mapped.
This standardizes the handling of nullability for the LogicalKeyboardKey.keyLabel and RawKeyEventData.keyLabel accessors so that they are non-nullable, but can be empty.
Before this change, the keyLabel could be either null or an empty string to indicate that there wasn't a label, which makes it harder to test for, since both need to be checked for. Since an empty string is sufficient, there is no need for it to be nullable.
Also, in raw_keyboard.dart, the web and Windows implementations wouldn't accept null values for parameters in the Map coming from the message, but tests were supplying null for some of them. This makes web and Windows creation of events match the other platforms, and makes the migration of tests to non-nullability easier.
This adds generation of some C++ keycode maps for various platforms.
This isn't meant for general use: it's so that the Flutter authors can keep the keycodes up to date with the Chromium and Android (and other) sources. It doesn't run continuously, it's only run occasionally (manually) to update the maps, because they don't change very often, and there is often manual work needed to make it function.
In this PR, I added output of various .cc files that write into an engine repo situated next to the flutter repo on disk. This is a starting point for implementing platform-side handling of key events.