summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian J. Johnson <bjohnson@sgi.com>2016-10-07 09:54:00 -0500
committerRyan Harkin <ryan.harkin@linaro.org>2016-10-12 09:54:30 +0100
commitf51ab72161a048877eb7f150d8d3b4e17c44b4e7 (patch)
treeb82f8f9160c6c535f475a85f5ce3e2888a6add9a
parentab0de01dff7f4dcfc0302ba0db7119d61fb5ee7e (diff)
MdeModulePkg/TerminalDxe: Handle more keys with TtyTermarmlt-20161018-001armlt-20161012-00116.10
The TtyTerm terminal driver is missing support for sequences produced by the page up, page down, insert, home, and end keys in some terimnal emulators. Add them. Tested under Ubuntu 16.04 using xterm 322-1ubuntu1, GNOME terminal 3.18.3-1ubuntu1, and XFCE terminal 0.6.3-2ubuntu1. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Kyle Roberts <kyroberts@sgi.com> Signed-off-by: Brian Johnson <bjohnson@sgi.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com>
-rw-r--r--MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index 3be877b466..c28db7c0e2 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -3,6 +3,7 @@
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1374,7 +1375,7 @@ UnicodeToEfiKey (
break;
}
} else if (TerminalDevice->TerminalType == TTYTERMTYPE) {
- /* Also accept VT100 escape codes for F1-F4 for TTY term */
+ /* Also accept VT100 escape codes for F1-F4, HOME and END for TTY term */
switch (UnicodeChar) {
case 'P':
Key.ScanCode = SCAN_F1;
@@ -1388,6 +1389,12 @@ UnicodeToEfiKey (
case 'S':
Key.ScanCode = SCAN_F4;
break;
+ case 'H':
+ Key.ScanCode = SCAN_HOME;
+ break;
+ case 'F':
+ Key.ScanCode = SCAN_END;
+ break;
}
}
@@ -1429,12 +1436,14 @@ UnicodeToEfiKey (
break;
case 'H':
if (TerminalDevice->TerminalType == PCANSITYPE ||
- TerminalDevice->TerminalType == VT100TYPE) {
+ TerminalDevice->TerminalType == VT100TYPE ||
+ TerminalDevice->TerminalType == TTYTERMTYPE) {
Key.ScanCode = SCAN_HOME;
}
break;
case 'F':
- if (TerminalDevice->TerminalType == PCANSITYPE) {
+ if (TerminalDevice->TerminalType == PCANSITYPE ||
+ TerminalDevice->TerminalType == TTYTERMTYPE) {
Key.ScanCode = SCAN_END;
}
break;
@@ -1573,9 +1582,18 @@ UnicodeToEfiKey (
TerminalDevice->TtyEscapeStr[TerminalDevice->TtyEscapeIndex] = 0; /* Terminate string */
EscCode = (UINT16) StrDecimalToUintn(TerminalDevice->TtyEscapeStr);
switch (EscCode) {
+ case 2:
+ Key.ScanCode = SCAN_INSERT;
+ break;
case 3:
Key.ScanCode = SCAN_DELETE;
break;
+ case 5:
+ Key.ScanCode = SCAN_PAGE_UP;
+ break;
+ case 6:
+ Key.ScanCode = SCAN_PAGE_DOWN;
+ break;
case 11:
case 12:
case 13: