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 <Phil.Noh@amd.com>
This commit is contained in:
Phil Noh 2024-09-13 15:43:57 -05:00 committed by mergify[bot]
parent 170fa8ecd4
commit 21e8a85653
2 changed files with 9 additions and 6 deletions

View File

@ -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 |

View File

@ -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;