From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.sgi.com [192.48.152.1]) by ml01.01.org (Postfix) with ESMTP id 4E3221A1E08 for ; Fri, 7 Oct 2016 07:54:01 -0700 (PDT) Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9162EAC002; Fri, 7 Oct 2016 07:54:00 -0700 (PDT) Received: from pc-bjohnson.americas.sgi.com (pc-bjohnson.americas.sgi.com [128.162.232.243]) by estes.americas.sgi.com (Postfix) with ESMTP id 442F496A4; Fri, 7 Oct 2016 09:54:00 -0500 (CDT) From: "Brian J. Johnson" To: edk2-devel@lists.01.org Cc: "Brian J. Johnson" , Feng Tian , Star Zeng Date: Fri, 7 Oct 2016 09:54:00 -0500 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH 3/3] MdeModulePkg/TerminalDxe: Handle more keys with TtyTerm X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Oct 2016 14:54:01 -0000 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 Signed-off-by: Brian Johnson Cc: Feng Tian Cc: Star Zeng --- .../Universal/Console/TerminalDxe/TerminalConIn.c | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 3be877b..5c3ea86 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.
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.
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: -- 2.7.4