Fix Linux keyboard support for AltGr (#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 https://github.com/flutter/flutter/issues/154053
This commit is contained in:
Robert Ancell 2025-02-11 14:03:48 +13:00 committed by GitHub
parent 29827d75f3
commit af3c91045b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 7 deletions

View File

@ -19,7 +19,7 @@
"NumpadDecimal": ["KP_Period", "KP_Delete"],
"NumpadEnter": ["KP_Enter"],
"AltLeft": ["Alt_L"],
"AltRight": ["Alt_R", "ISO_Level3_Shift"],
"AltRight": ["Alt_R"],
"ArrowDown": ["Down"],
"ArrowLeft": ["Left"],
"ArrowRight": ["Right"],

View File

@ -1663,6 +1663,14 @@
"names": {
"web": [
"AltGraph"
],
"gtk": [
"ISO_Level3_Shift"
]
},
"values": {
"gtk": [
65027
]
}
},
@ -8113,8 +8121,7 @@
"AltRight"
],
"gtk": [
"Alt_R",
"ISO_Level3_Shift"
"Alt_R"
],
"windows": [
"RMENU"
@ -8134,8 +8141,7 @@
230
],
"gtk": [
65514,
65027
65514
],
"windows": [
165

View File

@ -246,7 +246,7 @@ std::map<uint64_t, uint64_t> gtk_keyval_to_logical_key_map = {
{0x0000fd1b, 0x00100000406}, // 3270_ExSelect
{0x0000fd1d, 0x00100000608}, // 3270_PrintScreen
{0x0000fd1e, 0x0010000000d}, // 3270_Enter
{0x0000fe03, 0x00200000105}, // ISO_Level3_Shift
{0x0000fe03, 0x00100000103}, // ISO_Level3_Shift
{0x0000fe08, 0x00100000709}, // ISO_Next_Group
{0x0000fe0a, 0x0010000070a}, // ISO_Prev_Group
{0x0000fe0c, 0x00100000707}, // ISO_First_Group

View File

@ -1753,7 +1753,7 @@ const Map<int, LogicalKeyboardKey> kGtkToLogicalKey = <int, LogicalKeyboardKey>{
64795: LogicalKeyboardKey.exSel,
64797: LogicalKeyboardKey.printScreen,
64798: LogicalKeyboardKey.enter,
65027: LogicalKeyboardKey.altRight,
65027: LogicalKeyboardKey.altGraph,
65032: LogicalKeyboardKey.groupNext,
65034: LogicalKeyboardKey.groupPrevious,
65036: LogicalKeyboardKey.groupFirst,