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.
diff --git a/dev/tools/gen_keycodes/data/keyboard_key.tmpl b/dev/tools/gen_keycodes/data/keyboard_key.tmpl
index 740a945..eaed68c 100644
--- a/dev/tools/gen_keycodes/data/keyboard_key.tmpl
+++ b/dev/tools/gen_keycodes/data/keyboard_key.tmpl
@@ -280,7 +280,7 @@
   /// 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 @@
     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 @@
 @@@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 @@
 
   // 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 @@
   static const Map<int, String> _debugNames = kReleaseMode ?
     <int, String>{} :
     <int, String>{
-@@@PHYSICAL_KEY_DEBUG_NAMES@@@    };
+@@@PHYSICAL_KEY_DEBUG_NAMES@@@
+    };
 }