[gen_keycodes] Remove invalid Web code maps (#106074)

* Impl

* Test
This commit is contained in:
Tong Mu
2022-06-16 13:53:23 -07:00
committed by GitHub
parent 96813e9369
commit ddeb0b99c5
11 changed files with 41 additions and 54 deletions

View File

@@ -37,9 +37,9 @@ class WebCodeGenerator extends PlatformCodeGenerator {
String get _webPhysicalKeyCodeMap {
final OutputLines<String> lines = OutputLines<String>('Web physical map');
for (final PhysicalKeyEntry entry in keyData.entries) {
if (entry.name != null) {
lines.add(entry.name,
" '${entry.name}': ${toHex(entry.usbHidCode)}, // ${entry.constantName}");
for (final String webCode in entry.webCodes()) {
lines.add(webCode,
" '$webCode': ${toHex(entry.usbHidCode)}, // ${entry.constantName}");
}
}
return lines.sortedJoin().trimRight();