[key_codegen] Remove webValues (#81678)

Removes webValues from logical_key_data.json. Web's logical mapping should map webNames to logical key values, i.e. entry.value.
This commit is contained in:
Tong Mu
2021-05-10 03:16:25 -07:00
committed by GitHub
parent d28737eedf
commit 0e251e0ae1
5 changed files with 17 additions and 1571 deletions

View File

@@ -21,13 +21,13 @@ class WebCodeGenerator extends PlatformCodeGenerator {
/// This generates the map of Web KeyboardEvent codes to logical key ids.
String get _webLogicalKeyCodeMap {
final StringBuffer result = StringBuffer();
final OutputLines<String> lines = OutputLines<String>('Web logical map');
for (final LogicalKeyEntry entry in logicalData.entries) {
zipStrict(entry.webValues, entry.webNames, (int value, String name) {
result.writeln(" '$name': ${toHex(value, digits: 10)},");
});
for (final String name in entry.webNames) {
lines.add(name, " '$name': ${toHex(entry.value, digits: 11)},");
}
}
return result.toString().trimRight();
return lines.sortedJoin().trimRight();
}
/// This generates the map of Web KeyboardEvent codes to physical key USB HID codes.