Skip to content

Commit af3c910

Browse files
Fix Linux keyboard support for AltGr (flutter#162495)
This was previously connected to right alt, which was confusing the keyboard handling code into generating up events for this key when it didn't match the expected values. This key is also configurable, and only defaults to right alt in Ubuntu/GNOME. Fixes flutter#154053
1 parent 29827d7 commit af3c910

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

dev/tools/gen_keycodes/data/gtk_logical_name_mapping.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"NumpadDecimal": ["KP_Period", "KP_Delete"],
2020
"NumpadEnter": ["KP_Enter"],
2121
"AltLeft": ["Alt_L"],
22-
"AltRight": ["Alt_R", "ISO_Level3_Shift"],
22+
"AltRight": ["Alt_R"],
2323
"ArrowDown": ["Down"],
2424
"ArrowLeft": ["Left"],
2525
"ArrowRight": ["Right"],

dev/tools/gen_keycodes/data/logical_key_data.g.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,14 @@
16631663
"names": {
16641664
"web": [
16651665
"AltGraph"
1666+
],
1667+
"gtk": [
1668+
"ISO_Level3_Shift"
1669+
]
1670+
},
1671+
"values": {
1672+
"gtk": [
1673+
65027
16661674
]
16671675
}
16681676
},
@@ -8113,8 +8121,7 @@
81138121
"AltRight"
81148122
],
81158123
"gtk": [
8116-
"Alt_R",
8117-
"ISO_Level3_Shift"
8124+
"Alt_R"
81188125
],
81198126
"windows": [
81208127
"RMENU"
@@ -8134,8 +8141,7 @@
81348141
230
81358142
],
81368143
"gtk": [
8137-
65514,
8138-
65027
8144+
65514
81398145
],
81408146
"windows": [
81418147
165

engine/src/flutter/shell/platform/linux/key_mapping.g.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ std::map<uint64_t, uint64_t> gtk_keyval_to_logical_key_map = {
246246
{0x0000fd1b, 0x00100000406}, // 3270_ExSelect
247247
{0x0000fd1d, 0x00100000608}, // 3270_PrintScreen
248248
{0x0000fd1e, 0x0010000000d}, // 3270_Enter
249-
{0x0000fe03, 0x00200000105}, // ISO_Level3_Shift
249+
{0x0000fe03, 0x00100000103}, // ISO_Level3_Shift
250250
{0x0000fe08, 0x00100000709}, // ISO_Next_Group
251251
{0x0000fe0a, 0x0010000070a}, // ISO_Prev_Group
252252
{0x0000fe0c, 0x00100000707}, // ISO_First_Group

packages/flutter/lib/src/services/keyboard_maps.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ const Map<int, LogicalKeyboardKey> kGtkToLogicalKey = <int, LogicalKeyboardKey>{
17531753
64795: LogicalKeyboardKey.exSel,
17541754
64797: LogicalKeyboardKey.printScreen,
17551755
64798: LogicalKeyboardKey.enter,
1756-
65027: LogicalKeyboardKey.altRight,
1756+
65027: LogicalKeyboardKey.altGraph,
17571757
65032: LogicalKeyboardKey.groupNext,
17581758
65034: LogicalKeyboardKey.groupPrevious,
17591759
65036: LogicalKeyboardKey.groupFirst,

0 commit comments

Comments
 (0)