Modify key info generation for new iOS key code. (#83439)

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 commit is contained in:
Greg Spencer
2021-07-20 04:24:43 -07:00
committed by GitHub
parent a5b9b5774a
commit 2cb685e157
10 changed files with 313 additions and 77 deletions

View File

@@ -5,6 +5,7 @@
import 'dart:convert';
import 'dart:io';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as path;
import 'constants.dart';
@@ -12,7 +13,12 @@ import 'constants.dart';
/// The location of the Flutter root directory, based on the known location of
/// this script.
final Directory flutterRoot = Directory(path.dirname(Platform.script.toFilePath())).parent.parent.parent.parent;
final String dataRoot = path.join(flutterRoot.path, 'dev', 'tools', 'gen_keycodes', 'data');
String get dataRoot => testDataRoot ?? _dataRoot;
String _dataRoot = path.join(flutterRoot.path, 'dev', 'tools', 'gen_keycodes', 'data');
/// Allows overriding of the [dataRoot] for testing purposes.
@visibleForTesting
String? testDataRoot;
/// Converts `FOO_BAR` to `FooBar`.
String shoutingToUpperCamel(String shouting) {