On Fri, Oct 7, 2016 at 7:54 AM, Brian J. Johnson <bjohn...@sgi.com> wrote: > 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 <kyrobe...@sgi.com> > Signed-off-by: Brian Johnson <bjohn...@sgi.com> > Cc: Feng Tian <feng.t...@intel.com> > Cc: Star Zeng <star.z...@intel.com> > --- > .../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.<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: > -- > 2.7.4 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel
Reviewed-by: Roy Franz <roy.fr...@hpe.com> This patch looks good to me - I'm not enough of a terminal expert to review patches 1/2. Roy _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel