Game controller button support (#33868)
This adds support for game controller buttons. It adds some supplemental USB HID codes that aren't available from the Chromium source code, and maps those on Android to the game pad buttons that Android supports. Other platforms are not supported yet.
This commit is contained in:
@@ -52,6 +52,12 @@ Future<void> main(List<String> rawArguments) async {
|
||||
'read. If --chromium-hid-codes is not specified, the input will be read '
|
||||
'from the correct file in the Chromium repository.',
|
||||
);
|
||||
argParser.addOption(
|
||||
'supplemental-hid-codes',
|
||||
defaultsTo: path.join(flutterRoot.path, 'dev', 'tools', 'gen_keycodes', 'data', 'supplemental_hid_codes.inc'),
|
||||
help: "The path to where the supplemental HID codes that don't appear in the "
|
||||
'Chromium map should be read.',
|
||||
);
|
||||
argParser.addOption(
|
||||
'android-keycodes',
|
||||
defaultsTo: null,
|
||||
@@ -140,6 +146,9 @@ Future<void> main(List<String> rawArguments) async {
|
||||
hidCodes = File(parsedArguments['chromium-hid-codes']).readAsStringSync();
|
||||
}
|
||||
|
||||
final String supplementalHidCodes = File(parsedArguments['supplemental-hid-codes']).readAsStringSync();
|
||||
hidCodes = '$hidCodes\n$supplementalHidCodes';
|
||||
|
||||
String androidKeyCodes;
|
||||
if (parsedArguments['android-keycodes'] == null) {
|
||||
androidKeyCodes = await getAndroidKeyCodes();
|
||||
|
||||
Reference in New Issue
Block a user