Key codegen for Hardware Keyboard: Linux (GTK) #82962

This commit is contained in:
Tong Mu
2021-06-17 02:14:44 -07:00
committed by GitHub
parent c6cd8a60c3
commit 32203c391f
2 changed files with 8 additions and 8 deletions

View File

@@ -27,7 +27,8 @@ class GtkCodeGenerator extends PlatformCodeGenerator {
final OutputLines<int> lines = OutputLines<int>('GTK scancode map');
for (final PhysicalKeyEntry entry in keyData.entries) {
if (entry.xKbScanCode != null) {
lines.add(entry.xKbScanCode!, ' insert_record(table, ${toHex(entry.xKbScanCode)}, ${toHex(entry.usbHidCode)}); // ${entry.constantName}');
lines.add(entry.xKbScanCode!,
' {${toHex(entry.xKbScanCode)}, ${toHex(entry.usbHidCode)}}, // ${entry.constantName}');
}
}
return lines.sortedJoin().trimRight();
@@ -38,7 +39,8 @@ class GtkCodeGenerator extends PlatformCodeGenerator {
final OutputLines<int> lines = OutputLines<int>('GTK keyval map');
for (final LogicalKeyEntry entry in logicalData.entries) {
zipStrict(entry.gtkValues, entry.gtkNames, (int value, String name) {
lines.add(value, ' insert_record(table, ${toHex(value)}, ${toHex(entry.value, digits: 11)}); // $name');
lines.add(value,
' {${toHex(value)}, ${toHex(entry.value, digits: 11)}}, // $name');
});
}
return lines.sortedJoin().trimRight();