From 21e8a85653e104385bfb8218fe22a72053bd3d2d Mon Sep 17 00:00:00 2001 From: Phil Noh Date: Fri, 13 Sep 2024 15:43:57 -0500 Subject: MdeModulePkg/TerminalDxe: Add VTUTF8 to Putty function key map REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4848 This patch is to support VTUTF8 type for Putty function key map. In Putty, it is required for translating a stream of Unicode characters for function keys on UTF8 correctly. Signed-off-by: Phil Noh --- MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h | 4 ++-- MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h index 7581cda18b..61fbd808ae 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h @@ -1216,8 +1216,8 @@ AnsiRawDataToUnicode ( Putty function key map: +=========+======+===========+=============+=============+=============+=========+ | | EFI | | | | | | - | | Scan | | | Normal | | | - | KEY | Code | VT100+ | Xterm R6 | VT400 | Linux | SCO | + | | Scan | VT100+ | | Normal | | | + | KEY | Code | VTUTF8 | Xterm R6 | VT400 | Linux | SCO | +=========+======+===========+=============+=============+=============+=========+ | F1 | 0x0B | ESC O P | ESC O P | ESC [ 1 1 ~ | ESC [ [ A | ESC [ M | | F2 | 0x0C | ESC O Q | ESC O Q | ESC [ 1 2 ~ | ESC [ [ B | ESC [ N | diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index fa1038ed43..dd31347402 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c @@ -1317,8 +1317,8 @@ UnicodeToEfiKeyFlushState ( Putty function key map: +=========+======+===========+=============+=============+=============+=========+ | | EFI | | | | | | - | | Scan | | | Normal | | | - | KEY | Code | VT100+ | Xterm R6 | VT400 | Linux | SCO | + | | Scan | VT100+ | | Normal | | | + | KEY | Code | VTUTF8 | Xterm R6 | VT400 | Linux | SCO | +=========+======+===========+=============+=============+=============+=========+ | F1 | 0x0B | ESC O P | ESC O P | ESC [ 1 1 ~ | ESC [ [ A | ESC [ M | | F2 | 0x0C | ESC O Q | ESC O Q | ESC [ 1 2 ~ | ESC [ [ B | ESC [ N | @@ -1395,7 +1395,8 @@ UnicodeToEfiKey ( if ((UnicodeChar == 'O') && ((TerminalDevice->TerminalType == TerminalTypeVt100) || (TerminalDevice->TerminalType == TerminalTypeTtyTerm) || (TerminalDevice->TerminalType == TerminalTypeXtermR6) || - (TerminalDevice->TerminalType == TerminalTypeVt100Plus))) + (TerminalDevice->TerminalType == TerminalTypeVt100Plus) || + (TerminalDevice->TerminalType == TerminalTypeVtUtf8))) { TerminalDevice->InputState |= INPUT_STATE_O; TerminalDevice->ResetState = RESET_STATE_DEFAULT; @@ -1569,7 +1570,9 @@ UnicodeToEfiKey ( Key.ScanCode = SCAN_END; break; } - } else if (TerminalDevice->TerminalType == TerminalTypeVt100Plus) { + } else if ((TerminalDevice->TerminalType == TerminalTypeVt100Plus) || + (TerminalDevice->TerminalType == TerminalTypeVtUtf8)) + { switch (UnicodeChar) { case 'P': Key.ScanCode = SCAN_F1; -- cgit v1.2.3