mirror of
https://github.com/flutter/flutter
synced 2024-09-19 16:21:58 +00:00
Key codegen for Hardware Keyboard: Linux (GTK) #82962
This commit is contained in:
parent
c6cd8a60c3
commit
32203c391f
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue