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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -7,8 +7,6 @@
#include <glib.h>
#include <map>
#include "flutter/shell/platform/linux/fl_key_embedder_responder_private.h"
// DO NOT EDIT -- DO NOT EDIT -- DO NOT EDIT
// This file is generated by
// flutter/flutter@dev/tools/gen_keycodes/bin/gen_keycodes.dart and should not
@ -25,13 +23,13 @@ static bool insert_record(GHashTable* table, guint64 xkb, guint64 fl_key) {
uint64_to_gpointer(fl_key));
}
void initialize_xkb_to_physical_key(GHashTable* table) {
std::map<uint64_t, uint64_t> xkb_to_physical_key_map = {
@@@XKB_SCAN_CODE_MAP@@@
}
};
void initialize_gtk_keyval_to_logical_key(GHashTable* table) {
std::map<uint64_t, uint64_t> gtk_keyval_to_logical_key_map = {
@@@GTK_KEYVAL_CODE_MAP@@@
}
};
void initialize_modifier_bit_to_checked_keys(GHashTable* table) {
FlKeyEmbedderCheckedKey* data;

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();